Skip to content

Commit

Permalink
Renamed SceneNodeAttribute to NodeAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
returnString committed Jul 10, 2012
1 parent 9b7cda0 commit 5591b61
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 22 deletions.
1 change: 0 additions & 1 deletion ManagedFbx.Samples/FbxForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public partial class FbxForm : Form
public FbxForm(Scene scene)
{
InitializeComponent();
AllowDrop = true;
Add(scene.RootNode, null);
}

Expand Down
12 changes: 6 additions & 6 deletions ManagedFbx/ManagedFbx.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<LinkIncremental>true</LinkIncremental>
<IncludePath>C:\Program Files\Autodesk\FBX\FBX SDK\2013.2\include\;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files\Autodesk\FBX\FBX SDK\2013.2\lib\vs2010\x86;$(LibraryPath)</LibraryPath>
<OutDir>$(SolutionDir)\Build</OutDir>
<OutDir>$(SolutionDir)Build</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
Expand Down Expand Up @@ -89,21 +89,21 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include=".\Manager.h" />
<ClInclude Include=".\NativeString.h" />
<ClInclude Include="Manager.h" />
<ClInclude Include="NativeString.h" />
<ClInclude Include="FbxException.h" />
<ClInclude Include="Properties.h" />
<ClInclude Include="Scene.h" />
<ClInclude Include="SceneNode.h" />
<ClInclude Include="SceneNodeAttribute.h" />
<ClInclude Include="NodeAttribute.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="Vector.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include=".\Manager.cpp" />
<ClCompile Include="Manager.cpp" />
<ClCompile Include="Scene.cpp" />
<ClCompile Include="SceneNode.cpp" />
<ClCompile Include="SceneNodeAttribute.cpp" />
<ClCompile Include="NodeAttribute.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
Expand Down
4 changes: 2 additions & 2 deletions ManagedFbx/ManagedFbx.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Filter>Helpers</Filter>
</ClCompile>
<ClCompile Include="SceneNode.cpp" />
<ClCompile Include="SceneNodeAttribute.cpp" />
<ClCompile Include=".\NodeAttribute.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include=".\NativeString.h">
Expand All @@ -22,13 +22,13 @@
<ClInclude Include="Properties.h">
<Filter>Helpers</Filter>
</ClInclude>
<ClInclude Include="SceneNodeAttribute.h" />
<ClInclude Include="Vector.h">
<Filter>Maths</Filter>
</ClInclude>
<ClInclude Include="FbxException.h">
<Filter>Exceptions</Filter>
</ClInclude>
<ClInclude Include=".\NodeAttribute.h" />
</ItemGroup>
<ItemGroup>
<Filter Include="Helpers">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
#include "stdafx.h"
#include "SceneNodeAttribute.h"
#include "NodeAttribute.h"

using namespace ManagedFbx;

SceneNodeAttribute::SceneNodeAttribute(FbxNodeAttribute *nativeAttr)
NodeAttribute::NodeAttribute(FbxNodeAttribute *nativeAttr)
{
m_nativeAttribute = nativeAttr;
}

NodeAttributeType^ SceneNodeAttribute::AttributeType::get()
NodeAttributeType^ NodeAttribute::AttributeType::get()
{
return (NodeAttributeType)m_nativeAttribute->GetAttributeType();
}

string ^SceneNodeAttribute::Name::get()
string ^NodeAttribute::Name::get()
{
return gcnew string(m_nativeAttribute->GetName());
}

void SceneNodeAttribute::Name::set(string ^value)
void NodeAttribute::Name::set(string ^value)
{
m_nativeAttribute->SetName(StringHelper::ToNative(value));
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ namespace ManagedFbx
Subdiv = FbxNodeAttribute::eSubDiv
};

public ref class SceneNodeAttribute
public ref class NodeAttribute
{
public:
property_r(NodeAttributeType^, AttributeType);
property_rw(string^, Name);

internal:
SceneNodeAttribute(FbxNodeAttribute *nativeAttr);
NodeAttribute(FbxNodeAttribute *nativeAttr);

private:
FbxNodeAttribute *m_nativeAttribute;
Expand Down
6 changes: 3 additions & 3 deletions ManagedFbx/SceneNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SceneNode::SceneNode(FbxNode *node)
m_nativeNode = node;

m_children = gcnew List<SceneNode^>();
m_attributes = gcnew List<SceneNodeAttribute^>();
m_attributes = gcnew List<NodeAttribute^>();

for(int i = 0; i < m_nativeNode->GetChildCount(); i++)
{
Expand All @@ -19,7 +19,7 @@ SceneNode::SceneNode(FbxNode *node)
for(int i = 0; i < m_nativeNode->GetNodeAttributeCount(); i++)
{
auto attr = m_nativeNode->GetNodeAttributeByIndex(i);
m_attributes->Add(gcnew SceneNodeAttribute(attr));
m_attributes->Add(gcnew NodeAttribute(attr));
}
}

Expand All @@ -28,7 +28,7 @@ IEnumerable<SceneNode^>^ SceneNode::ChildNodes::get()
return m_children->AsReadOnly();
}

IEnumerable<SceneNodeAttribute^>^ SceneNode::Attributes::get()
IEnumerable<NodeAttribute^>^ SceneNode::Attributes::get()
{
return m_attributes->AsReadOnly();
}
Expand Down
6 changes: 3 additions & 3 deletions ManagedFbx/SceneNode.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "SceneNodeAttribute.h"
#include "NodeAttribute.h"

using namespace System::Collections::Generic;

Expand All @@ -11,7 +11,7 @@ namespace ManagedFbx
public:
property_rw(string^, Name);
property_r(IEnumerable<SceneNode^>^, ChildNodes);
property_r(IEnumerable<SceneNodeAttribute^>^, Attributes);
property_r(IEnumerable<NodeAttribute^>^, Attributes);

property_rw(Vector3, Position);
property_rw(Vector3, Rotation);
Expand All @@ -25,6 +25,6 @@ namespace ManagedFbx
private:
FbxNode *m_nativeNode;
List<SceneNode^> ^m_children;
List<SceneNodeAttribute^> ^m_attributes;
List<NodeAttribute^> ^m_attributes;
};
}
21 changes: 21 additions & 0 deletions ManagedFbx/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,25 @@ namespace ManagedFbx
Z = fbxDouble[2];
}
};

public value struct Vector4
{
Vector4(double w, double x, double y, double z)
{
W = w;
X = x;
Y = y;
Z = z;
}

operator FbxDouble4()
{
return FbxDouble4(X, Y, Z, W);
}

property double W;
property double X;
property double Y;
property double Z;
};
}

0 comments on commit 5591b61

Please sign in to comment.