Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chaojian-zhang committed May 19, 2018
0 parents commit 3c7dbaa
Show file tree
Hide file tree
Showing 383 changed files with 118,608 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
Empty file added Debug/test.dream
Empty file.
Binary file added Libraries/assimp--3.0.1270-full.zip
Binary file not shown.
Binary file added Libraries/freetype-2.3.5-1-bin_x86.zip
Binary file not shown.
Binary file added Libraries/glew-1.12.0-win32.zip
Binary file not shown.
Binary file added Libraries/glfw-3.1.1.bin.WIN32.zip
Binary file not shown.
Binary file added Libraries/glm-0.9.6.3.zip
Binary file not shown.
Binary file added Node Editor.sdf
Binary file not shown.
22 changes: 22 additions & 0 deletions Node Editor.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Node Editor", "Node Editor\Node Editor.vcxproj", "{C27A9DE6-B76B-4790-B65D-8E222F58FD18}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C27A9DE6-B76B-4790-B65D-8E222F58FD18}.Debug|Win32.ActiveCfg = Debug|Win32
{C27A9DE6-B76B-4790-B65D-8E222F58FD18}.Debug|Win32.Build.0 = Debug|Win32
{C27A9DE6-B76B-4790-B65D-8E222F58FD18}.Release|Win32.ActiveCfg = Release|Win32
{C27A9DE6-B76B-4790-B65D-8E222F58FD18}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added Node Editor.v12.suo
Binary file not shown.
2 changes: 2 additions & 0 deletions Node Editor/Constants.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Naming convention used in this application: words in vairiables are Uppercase seperated, Enums are Uppercase Beginned, Macros are _ seperated when needed
// Objects Class are defined beginning with Uppercase characters.
113 changes: 113 additions & 0 deletions Node Editor/GraphManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#ifndef GRAPHMANGER_H
#define GRAPHMANGER_H
#include "node.h"
#include "InterfaceComponents.h"
#include <stdio.h> // Provides FILE
#include "include\GLFW\glfw3.h" // Window creation is handled by the application, but graph manager need this lib to resond to window events

enum GraphType
{
DreamNoteGraph,

};

struct CalendarTime
{
unsigned short year;
unsigned short month;
unsigned short day;
unsigned short hour;
unsigned short minute;
unsigned short second;
};

class GraphManager
{
public:
// Interaction Functions, only need to implement Graph Specific functionalities
// Text Input
virtual void OnCharInput() = 0;
// Keyboard
virtual void OnKeyboardButton(int key, int scancode, int action, int mods) = 0;
// Mouse
virtual void OnMouseButton() = 0;
virtual void OnMouseMove() = 0;
virtual void ObjectDispatch() = 0; // Collision Detection

// Uopdate Functions
void UpdareTimer(double inTime){ time = inTime; };
virtual void UpdateInterface() = 0; // Update text fieds stuff
virtual void UpdateNodes() = 0; // Do animation stuff

// Render Functions
virtual void RenderMenuBar() = 0; // Called Perframe
virtual void RenderSidePanel() = 0; // Only when needed
virtual void RenderCanvas() = 0; // Only when needed

// Object Serialization
virtual void SaveGraph() = 0;
virtual void LoadGraph(FILE* file) = 0; // First byte is already read for window creation; We just need to read what is meaning for to us

// Object Cleanup
virtual void CleanUp() = 0;
private:
// Graph Datas, those are things that need to be saved and loaded
// Graph Type
GraphType graphType;

// Graph Metadata
struct CalendarTime creationTime;
struct CalendarTime modifyTime;

// The properties and resources below are graph specific thus defined only when needed
// Graph Specific Properties
// Resources
private:
// Environment Variables, these are things that only used in run-time
// Main Menu Bar
Menubar* mainMenubar;
// Side Panel
SidePanel* sidePanel;
// Canvas
Canvas* canvas;

// Small Variables
// Window Style Control
bool bDecoration;
// File handle
FILE* graphFile;
// Global timer
double time = 0;

// Object Tracking
// Current Selected Nodes
Node* currentSelection;
// Current Selected Connection
Noodle* connection;
};

class FramelessWindow : public GraphManager
{
protected:
// Window Movement handling
void WindowMove();
// Window Resizing handling
void WindowResize();
private:
// window states
double mouseDownX, mouseDownY;
bool bLMBDown;
};

class FrameedWindow : public GraphManager
{
protected:
// Window Resizing handling
void WindowResize();
};

class DreamNoteManager : public FramelessWindow
{

};
#endif
53 changes: 53 additions & 0 deletions Node Editor/InterfaceComponents.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#ifndef INTERFACECOMPONENTS_H
#define INTERFACECOMPONENTS_H
#include "Widgets.h"
// Used by main menu bar
class PopupMenu
{

};

// Used by Sidepanel and Canvas for navigation
class Camera
{

};

// The three interfaces can have different viewports in some graphs, or they may just write on the same viewport, i.e. Viewports can overlap each other
struct Viewport
{
unsigned short x; // Specified from UP to LR
unsigned short y; // Specified from UP to LR
unsigned short width;
unsigned short height;
};

// Menubar and Sidepanel to use are all just interface drawing areas, since they are implemented using the same components
class InterfaceArea
{
protected:
Widget** widgets;
};

class Menubar: public InterfaceArea
{
private:
// Menubar Exclusive objects
PopupMenu** popupMenus;
};

class SidePanel: public InterfaceArea
{
private:
// Side Panel Special Objects
Camera* sidePanelCamera;
};

// Canvas is conceptualy a seperate 3D space, but some 3D interface components like labels might also be useful
class Canvas: public InterfaceArea
{
private:
// Canvas Objects
Camera* canvasCamera;
};
#endif
94 changes: 94 additions & 0 deletions Node Editor/Node Editor.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C27A9DE6-B76B-4790-B65D-8E222F58FD18}</ProjectGuid>
<RootNamespace>NodeEditor</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<IncludePath>$(MSBuildProjectDirectory)\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>$(MSBuildProjectDirectory)\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>
</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
<ClCompile Include="Notes.cpp" />
<ClCompile Include="Utilities.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Constants.h" />
<ClInclude Include="GraphManager.h" />
<ClInclude Include="InterfaceComponents.h" />
<ClInclude Include="Node.h" />
<ClInclude Include="ShaderSources.h" />
<ClInclude Include="SystemSpecifc.h" />
<ClInclude Include="Utilitites.h" />
<ClInclude Include="Widgets.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
54 changes: 54 additions & 0 deletions Node Editor/Node Editor.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Notes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Utilities.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Constants.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="GraphManager.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="SystemSpecifc.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="ShaderSources.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Node.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="InterfaceComponents.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Widgets.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="Utilitites.h">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions Node Editor/Node Editor.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommandArguments>"E:\Projects\按项目分类 - 执行和创造用\Application Development\Node Editor\Debug\test.dream"</LocalDebuggerCommandArguments>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
Loading

0 comments on commit 3c7dbaa

Please sign in to comment.