Skip to content

Commit 4885866

Browse files
committed
Fixed typos and improved code style consistency.
1 parent 11e16ec commit 4885866

15 files changed

Lines changed: 53 additions & 55 deletions

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if(VISUAL_NODE_SYSTEM_BUILD_SHARED_LIBS)
6666
target_compile_definitions(VisualNodeSystem PRIVATE VISUAL_NODE_SYSTEM_EXPORTS)
6767
target_compile_definitions(VisualNodeSystem PUBLIC VISUAL_NODE_SYSTEM_SHARED)
6868

69-
# Some times /GL conflicts with WINDOWS_EXPORT_ALL_SYMBOLS
69+
# Sometimes /GL conflicts with WINDOWS_EXPORT_ALL_SYMBOLS
7070
set_target_properties(VisualNodeSystem PROPERTIES COMPILE_OPTIONS "/GL-")
7171
set_target_properties(VisualNodeSystem PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
7272

@@ -86,7 +86,7 @@ set(VISUAL_NODE_SYSTEM_THIRDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty)
8686
# set the startup project
8787
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT VisualNodeSystem)
8888

89-
# Promt to give Dear ImGui path
89+
# Prompt to give Dear ImGui path
9090
set(DEAR_IMGUI_INCLUDE_DIR "" CACHE PATH "Path to Dear ImGui directory.")
9191

9292
if(VISUAL_NODE_SYSTEM_BUILD_SHARED_LIBS)

GroupComment.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "GroupComment.h"
22
using namespace VisNodeSys;
33

4-
char GroupComment::GroupCommentRename[GROUP_COMMENT_CAPTION_MAX_LENGHT] = "";
4+
char GroupComment::GroupCommentRename[GROUP_COMMENT_CAPTION_MAX_LENGTH] = "";
55

66
GroupComment::GroupComment(const std::string ID)
77
{

GroupComment.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace VisNodeSys
66
{
7-
#define GROUP_COMMENT_CAPTION_MAX_LENGHT 1024
7+
#define GROUP_COMMENT_CAPTION_MAX_LENGTH 1024
88
#define GROUP_COMMENT_TITLE_HEIGHT 30.0f
99

1010
class VISUAL_NODE_SYSTEM_API GroupComment
@@ -27,12 +27,12 @@ namespace VisNodeSys
2727
std::string Caption;
2828

2929
bool bIsRenamingActive = false;
30-
bool bLastFrameRenameEditWasVisiable = false;
30+
bool bLastFrameRenameEditWasVisible = false;
3131

3232
bool bVerticalResizeActive = false;
3333
bool bHorizontalResizeActive = false;
3434

35-
static char GroupCommentRename[GROUP_COMMENT_CAPTION_MAX_LENGHT];
35+
static char GroupCommentRename[GROUP_COMMENT_CAPTION_MAX_LENGTH];
3636

3737
float GetCaptionHeight(float Zoom) const;
3838
ImVec2 GetCaptionSize(float Zoom) const;

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66

77
This library provides a powerful framework for creating and managing visual node systems. These are typically used in graphical programming environments, game logic builders, and AI behavior tree editors.
88

9-
Master branch is free of tests to maintain its lightweightness. All test-related stuff (except GitHub Actions) is located in the [Tests Branch](https://github.com/Azzinoth/VisualNodeSystem/tree/tests)
9+
Master branch is free of tests to keep it lightweight. All test-related stuff (except GitHub Actions) is located in the [Tests Branch](https://github.com/Azzinoth/VisualNodeSystem/tree/tests)
1010

1111
## Key Features
1212

13-
- **Unchanged Dear Imgui**: This project does not depend on modifications to Dear Imgui.
13+
- **Unchanged Dear ImGui**: This project does not depend on modifications to Dear ImGui.
1414

1515
- **Zoom**: Zoom functionality enables detailed viewing and efficient navigation. The font system ensures precise text rendering at various zoom levels.
1616
<div align="center">
1717
<img src="https://github.com/Azzinoth/VisualNodeSystem/blob/media/Zoom.gif" width="60%">
1818
</div>
1919

20-
- **Reroute Nodes**: Reroute nodes offer enhanced organization for clearer, more readable visual graphs, enabling flexible customization of connection paths. Also they simplify debugging by making connections traceable. To add reroute node just double click on connection.
20+
- **Reroute Nodes**: Reroute nodes offer enhanced organization for clearer, more readable visual graphs, enabling flexible customization of connection paths. They also simplify debugging by making connections traceable. To add a reroute node, just double-click on a connection.
2121
<div align="center">
2222
<img src="https://github.com/Azzinoth/VisualNodeSystem/blob/media/RerouteNodes.gif" width="60%">
2323
</div>
@@ -36,7 +36,7 @@ Master branch is free of tests to maintain its lightweightness. All test-related
3636
<img src="https://github.com/Azzinoth/VisualNodeSystem/blob/media/Copy and Paste.gif" width="60%">
3737
</div>
3838

39-
- **Node Factory For Child Node Creation**: The library includes a system for creating child nodes using node factory, which enables JSON serialization of custom nodes.
39+
- **Node Factory For Child Node Creation**: The library includes a system for creating child nodes using a node factory, which enables JSON serialization of custom nodes.
4040

4141
- **Custom Context Menus**: The library supports the integration of custom context menus.
4242

@@ -47,14 +47,14 @@ Master branch is free of tests to maintain its lightweightness. All test-related
4747
I have personally used it in two of my projects:
4848

4949
[Focal Engine Editor](https://github.com/Azzinoth/FocalEngineEditor)
50-
![Focal Engine editor material window](https://github.com/Azzinoth/VisualNodeSystem/blob/media/Focal%20Engine%20Editor%20example.png)
50+
![Focal Engine Editor material window](https://github.com/Azzinoth/VisualNodeSystem/blob/media/Focal%20Engine%20Editor%20example.png)
5151

5252
[Focal Engine Test Platform](https://github.com/Azzinoth/FocalEngineTestPlatform)
53-
![Focal Engine test platform](https://github.com/Azzinoth/VisualNodeSystem/blob/media/Test%20Platform%20example.png)
53+
![Focal Engine Test Platform](https://github.com/Azzinoth/VisualNodeSystem/blob/media/Test%20Platform%20example.png)
5454

5555
## Usage
5656

57-
**When using this project as a Git submodule, ensure you provide the path to Dear ImGui in your project. For a simple example of how to use library, see the [Visual Node System Example](https://github.com/Azzinoth/VisualNodeSystem-Example).**
57+
**When using this project as a Git submodule, ensure you provide the path to Dear ImGui in your project. For a simple example of how to use the library, see the [Visual Node System Example](https://github.com/Azzinoth/VisualNodeSystem-Example).**
5858

5959
To add this module to your project, use the following command:
6060

SubSystems/VisualNodeArea/VisualNodeArea.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ std::vector<ImVec2> NodeArea::GetTangentsForLine(const ImVec2 Begin, const ImVec
676676
return Result;
677677
}
678678

679-
bool NodeArea::IsRectsOverlaping(ImVec2 FirstRectMin, ImVec2 FirstRectSize, ImVec2 SecondRectMin, ImVec2 SecondRectSize)
679+
bool NodeArea::IsRectsOverlapping(ImVec2 FirstRectMin, ImVec2 FirstRectSize, ImVec2 SecondRectMin, ImVec2 SecondRectSize)
680680
{
681681
if (FirstRectMin.x < (SecondRectMin.x + SecondRectSize.x) &&
682682
(FirstRectMin.x + FirstRectSize.x) > SecondRectMin.x &&

SubSystems/VisualNodeArea/VisualNodeArea.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ namespace VisNodeSys
302302
bool IsSegmentInRegion(ImVec2 Begin, ImVec2 End, const int Steps);
303303
bool IsConnectionInRegion(Connection* Connection, const int Steps);
304304

305-
bool IsRectsOverlaping(ImVec2 FirstRectMin, ImVec2 FirstRectSize, ImVec2 SecondRectMin, ImVec2 SecondRectSize);
305+
bool IsRectsOverlapping(ImVec2 FirstRectMin, ImVec2 FirstRectSize, ImVec2 SecondRectMin, ImVec2 SecondRectSize);
306306
bool IsSecondRectInsideFirstOne(ImVec2 FirstRectMin, ImVec2 FirstRectSize, ImVec2 SecondRectMin, ImVec2 SecondRectSize) const;
307307
bool IsRectInMouseSelectionRegion(ImVec2 RectMin, ImVec2 RectSize);
308308
bool IsRectUnderMouse(ImVec2 RectMin, ImVec2 RectSize);
@@ -315,7 +315,7 @@ namespace VisNodeSys
315315
void SelectFontSettings() const;
316316

317317
void GroupCommentDoubleMouseClick();
318-
void AttachElemetnsToGroupComment(GroupComment* GroupComment);
318+
void AttachElementsToGroupComment(GroupComment* GroupComment);
319319
void MoveGroupComment(GroupComment* GroupComment, ImVec2 Delta);
320320

321321
void Render();

SubSystems/VisualNodeArea/VisualNodeAreaInput.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ bool NodeArea::IsRectInMouseSelectionRegion(ImVec2 RectMin, ImVec2 RectSize)
472472
else
473473
{
474474
// Check if a part of the Rect is inside MouseSelectRegion.
475-
return IsRectsOverlaping(RectMin, RectSize, MouseSelectRegionMin, MouseSelectRegionMax - MouseSelectRegionMin);
475+
return IsRectsOverlapping(RectMin, RectSize, MouseSelectRegionMin, MouseSelectRegionMax - MouseSelectRegionMin);
476476
}
477477

478478
return false;
@@ -481,7 +481,7 @@ bool NodeArea::IsRectInMouseSelectionRegion(ImVec2 RectMin, ImVec2 RectSize)
481481
bool NodeArea::IsRectUnderMouse(ImVec2 RectMin, ImVec2 RectSize)
482482
{
483483
static ImVec2 MouseCursorSize = ImVec2(5, 5);
484-
return IsRectsOverlaping(RectMin, RectSize, MouseCursorPosition, MouseCursorSize);
484+
return IsRectsOverlapping(RectMin, RectSize, MouseCursorPosition, MouseCursorSize);
485485
}
486486

487487
void NodeArea::MouseDraggingNodesUpdate()
@@ -864,7 +864,7 @@ bool NodeArea::AddSelected(GroupComment* GroupComment)
864864

865865
GroupComment->bSelected = true;
866866
SelectedGroupComments.push_back(GroupComment);
867-
AttachElemetnsToGroupComment(GroupComment);
867+
AttachElementsToGroupComment(GroupComment);
868868

869869
return true;
870870
}

SubSystems/VisualNodeArea/VisualNodeAreaLogic.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void NodeArea::Delete(Connection* Connection)
7979
if (Connection->In->ConnectedSockets[i] == Connection->Out)
8080
{
8181
Connection->In->ConnectedSockets.erase(Connection->In->ConnectedSockets.begin() + i, Connection->In->ConnectedSockets.begin() + i + 1);
82-
// To-Do : Add some variation of disconnected event, like DISCONNECTED_INCOMING
82+
// TO-DO : Add some variation of disconnected event, like DISCONNECTED_INCOMING
8383
Connection->In->Parent->SocketEvent(Connection->In, Connection->Out, bClearing ? DESTRUCTION : DISCONNECTED);
8484
i--;
8585
}
@@ -90,7 +90,7 @@ void NodeArea::Delete(Connection* Connection)
9090
if (Connection->Out->ConnectedSockets[i] == Connection->In)
9191
{
9292
Connection->Out->ConnectedSockets.erase(Connection->Out->ConnectedSockets.begin() + i, Connection->Out->ConnectedSockets.begin() + i + 1);
93-
// To-Do : Add some variation of disconnected event, like DISCONNECTED_OUTGOING
93+
// TO-DO : Add some variation of disconnected event, like DISCONNECTED_OUTGOING
9494
i--;
9595
}
9696
}
@@ -784,7 +784,7 @@ std::vector<GroupComment*> NodeArea::GetGroupCommentsInGroupComment(GroupComment
784784
return Result;
785785
}
786786

787-
void NodeArea::AttachElemetnsToGroupComment(GroupComment* GroupComment)
787+
void NodeArea::AttachElementsToGroupComment(GroupComment* GroupComment)
788788
{
789789
GroupComment->AttachedNodes.clear();
790790
GroupComment->AttachedRerouteNodes.clear();

SubSystems/VisualNodeArea/VisualNodeAreaRendering.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ void NodeArea::RenderNodeSocket(NodeSocket* Socket) const
133133
}
134134

135135
ImColor SocketColor = DEFAULT_NODE_SOCKET_COLOR;
136-
if (NodeSocket::SocketTypeToColorAssosiations.find(Socket->GetType()) != NodeSocket::SocketTypeToColorAssosiations.end())
137-
SocketColor = NodeSocket::SocketTypeToColorAssosiations[Socket->GetType()];
136+
if (NodeSocket::SocketTypeToColorAssociations.find(Socket->GetType()) != NodeSocket::SocketTypeToColorAssociations.end())
137+
SocketColor = NodeSocket::SocketTypeToColorAssociations[Socket->GetType()];
138138

139139
ImColor SocketInternalPartColor = ImColor(30, 30, 30);
140140
if (SocketHovered == Socket)
@@ -165,8 +165,8 @@ void NodeArea::RenderNodeSocket(NodeSocket* Socket) const
165165
static ConnectionStyle DefaultConnectionStyle;
166166

167167
ImColor ConnectionColor = ImColor(200, 200, 200);
168-
if (NodeSocket::SocketTypeToColorAssosiations.find(SocketLookingForConnection->GetType()) != NodeSocket::SocketTypeToColorAssosiations.end())
169-
ConnectionColor = NodeSocket::SocketTypeToColorAssosiations[SocketLookingForConnection->GetType()];
168+
if (NodeSocket::SocketTypeToColorAssociations.find(SocketLookingForConnection->GetType()) != NodeSocket::SocketTypeToColorAssociations.end())
169+
ConnectionColor = NodeSocket::SocketTypeToColorAssociations[SocketLookingForConnection->GetType()];
170170

171171
CurrentDrawList->ChannelsSetCurrent(3);
172172
DrawHermiteLine(SocketPosition, ImGui::GetIO().MousePos, Settings.Style.GeneralConnection.LineSegments, ConnectionColor, &DefaultConnectionStyle);
@@ -307,7 +307,7 @@ void NodeArea::Render()
307307
// 0 - connections.
308308
// 1 - main node rect.
309309
// 2 - for custom node draw.
310-
// 3 - for line that represent new connection.
310+
// 3 - for line that represents new connection.
311311
CurrentDrawList->ChannelsSplit(4);
312312

313313
// We need to render comments first, because they should be on top layer.
@@ -329,7 +329,7 @@ void NodeArea::Render()
329329
}
330330

331331
// Connection should be on node's top layer.
332-
// But with my current realization it would be better to call it after renderNode.
332+
// But with my current implementation it would be better to call it after RenderNode.
333333
CurrentDrawList->ChannelsSetCurrent(0);
334334
for (size_t i = 0; i < Connections.size(); i++)
335335
{
@@ -530,8 +530,8 @@ void NodeArea::RenderConnection(const Connection* Connection) const
530530
return;
531531

532532
ImColor CurrentConnectionColor = Connection->Style.ForceColor;
533-
if (NodeSocket::SocketTypeToColorAssosiations.find(Connection->Out->GetType()) != NodeSocket::SocketTypeToColorAssosiations.end())
534-
CurrentConnectionColor = NodeSocket::SocketTypeToColorAssosiations[Connection->Out->GetType()];
533+
if (NodeSocket::SocketTypeToColorAssociations.find(Connection->Out->GetType()) != NodeSocket::SocketTypeToColorAssociations.end())
534+
CurrentConnectionColor = NodeSocket::SocketTypeToColorAssociations[Connection->Out->GetType()];
535535

536536
std::vector<ConnectionSegment> Segments = GetConnectionSegments(Connection);
537537
for (size_t i = 0; i < Segments.size(); i++)
@@ -848,12 +848,12 @@ void NodeArea::RenderGroupComment(GroupComment* GroupComment)
848848
// Render the caption background.
849849
CurrentDrawList->AddRectFilled(CaptionPosition, CaptionPosition + CaptionSize, CaptionBackgroundColor, 2.0f * Zoom);
850850

851-
if (!GroupComment->bLastFrameRenameEditWasVisiable)
851+
if (!GroupComment->bLastFrameRenameEditWasVisible)
852852
{
853853
ImGui::SetKeyboardFocusHere(0);
854854
ImGui::SetFocusID(ImGui::GetID("##newCommentEditor"), GetCurrentWindowImpl());
855855
ImGui::SetItemDefaultFocus();
856-
GroupComment->bLastFrameRenameEditWasVisiable = true;
856+
GroupComment->bLastFrameRenameEditWasVisible = true;
857857

858858
snprintf(VisNodeSys::GroupComment::GroupCommentRename,GroupComment->GetCaption().size() + 1, "%s", GroupComment->GetCaption().c_str());
859859
}

VisualNode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ std::string Node::GetName()
9696

9797
void Node::SetName(const std::string NewValue)
9898
{
99-
if (NewValue.size() > NODE_NAME_MAX_LENGHT)
99+
if (NewValue.size() > NODE_NAME_MAX_LENGTH)
100100
return;
101101

102102
Name = NewValue;

0 commit comments

Comments
 (0)