Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3djan/syncwithspec #370

Merged
merged 2 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Autogenerated/Bindings/C/lib3mf_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ typedef enum eLib3MFImplicitNodeType {
eImplicitNodeTypeFunctionCall = 45, /** Calls a function */
eImplicitNodeTypeMesh = 46, /** Calculates the signed distance to a mesh */
eImplicitNodeTypeLength = 47, /** Calculates the length of a vector */
eImplicitNodeTypeResource = 48, /** Selects a resource (function, mesh etc.) */
eImplicitNodeTypeConstResourceID = 48, /** Selects a resource (function, mesh etc.) */
eImplicitNodeTypeVectorFromScalar = 49, /** Creates a vector from one scalar values */
eImplicitNodeTypeUnsignedMesh = 50, /** Calculates the unsigned distance to a mesh */
eImplicitNodeTypeMod = 51 /** Calculates the modulo of two values (same behaviour as glsl mod) */
Expand Down
2 changes: 1 addition & 1 deletion Autogenerated/Bindings/CDynamic/lib3mf_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ typedef enum eLib3MFImplicitNodeType {
eImplicitNodeTypeFunctionCall = 45, /** Calls a function */
eImplicitNodeTypeMesh = 46, /** Calculates the signed distance to a mesh */
eImplicitNodeTypeLength = 47, /** Calculates the length of a vector */
eImplicitNodeTypeResource = 48, /** Selects a resource (function, mesh etc.) */
eImplicitNodeTypeConstResourceID = 48, /** Selects a resource (function, mesh etc.) */
eImplicitNodeTypeVectorFromScalar = 49, /** Creates a vector from one scalar values */
eImplicitNodeTypeUnsignedMesh = 50, /** Calculates the unsigned distance to a mesh */
eImplicitNodeTypeMod = 51 /** Calculates the modulo of two values (same behaviour as glsl mod) */
Expand Down
2 changes: 1 addition & 1 deletion Autogenerated/Bindings/CSharp/Lib3MF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public enum eImplicitNodeType {
FunctionCall = 45,
Mesh = 46,
Length = 47,
Resource = 48,
ConstResourceID = 48,
VectorFromScalar = 49,
UnsignedMesh = 50,
Mod = 51
Expand Down
2 changes: 1 addition & 1 deletion Autogenerated/Bindings/Cpp/lib3mf_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ namespace Lib3MF {
FunctionCall = 45, /** Calls a function */
Mesh = 46, /** Calculates the signed distance to a mesh */
Length = 47, /** Calculates the length of a vector */
Resource = 48, /** Selects a resource (function, mesh etc.) */
ConstResourceID = 48, /** Selects a resource (function, mesh etc.) */
VectorFromScalar = 49, /** Creates a vector from one scalar values */
UnsignedMesh = 50, /** Calculates the unsigned distance to a mesh */
Mod = 51 /** Calculates the modulo of two values (same behaviour as glsl mod) */
Expand Down
2 changes: 1 addition & 1 deletion Autogenerated/Bindings/CppDynamic/lib3mf_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ namespace Lib3MF {
FunctionCall = 45, /** Calls a function */
Mesh = 46, /** Calculates the signed distance to a mesh */
Length = 47, /** Calculates the length of a vector */
Resource = 48, /** Selects a resource (function, mesh etc.) */
ConstResourceID = 48, /** Selects a resource (function, mesh etc.) */
VectorFromScalar = 49, /** Creates a vector from one scalar values */
UnsignedMesh = 50, /** Calculates the unsigned distance to a mesh */
Mod = 51 /** Calculates the modulo of two values (same behaviour as glsl mod) */
Expand Down
2 changes: 1 addition & 1 deletion Autogenerated/Bindings/Go/lib3mf.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Autogenerated/Bindings/Go/lib3mf_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ typedef enum eLib3MFImplicitNodeType {
eImplicitNodeTypeFunctionCall = 45, /** Calls a function */
eImplicitNodeTypeMesh = 46, /** Calculates the signed distance to a mesh */
eImplicitNodeTypeLength = 47, /** Calculates the length of a vector */
eImplicitNodeTypeResource = 48, /** Selects a resource (function, mesh etc.) */
eImplicitNodeTypeConstResourceID = 48, /** Selects a resource (function, mesh etc.) */
eImplicitNodeTypeVectorFromScalar = 49, /** Creates a vector from one scalar values */
eImplicitNodeTypeUnsignedMesh = 50, /** Calculates the unsigned distance to a mesh */
eImplicitNodeTypeMod = 51 /** Calculates the modulo of two values (same behaviour as glsl mod) */
Expand Down
2 changes: 1 addition & 1 deletion Autogenerated/Bindings/NodeJS/lib3mf_nodewrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23676,7 +23676,7 @@ void CLib3MFWrapper::New(const FunctionCallbackInfo<Value>& args)
newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_FunctionCall"), Integer::New(isolate, 45));
newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_Mesh"), Integer::New(isolate, 46));
newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_Length"), Integer::New(isolate, 47));
newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_Resource"), Integer::New(isolate, 48));
newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_ConstResourceID"), Integer::New(isolate, 48));
newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_VectorFromScalar"), Integer::New(isolate, 49));
newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_UnsignedMesh"), Integer::New(isolate, 50));
newObject->Set(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "eImplicitNodeType_Mod"), Integer::New(isolate, 51));
Expand Down
2 changes: 1 addition & 1 deletion Autogenerated/Bindings/NodeJS/lib3mf_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ typedef enum eLib3MFImplicitNodeType {
eImplicitNodeTypeFunctionCall = 45, /** Calls a function */
eImplicitNodeTypeMesh = 46, /** Calculates the signed distance to a mesh */
eImplicitNodeTypeLength = 47, /** Calculates the length of a vector */
eImplicitNodeTypeResource = 48, /** Selects a resource (function, mesh etc.) */
eImplicitNodeTypeConstResourceID = 48, /** Selects a resource (function, mesh etc.) */
eImplicitNodeTypeVectorFromScalar = 49, /** Creates a vector from one scalar values */
eImplicitNodeTypeUnsignedMesh = 50, /** Calculates the unsigned distance to a mesh */
eImplicitNodeTypeMod = 51 /** Calculates the modulo of two values (same behaviour as glsl mod) */
Expand Down
6 changes: 3 additions & 3 deletions Autogenerated/Bindings/Pascal/Unit_Lib3MF.pas
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ interface
eImplicitNodeTypeFunctionCall,
eImplicitNodeTypeMesh,
eImplicitNodeTypeLength,
eImplicitNodeTypeResource,
eImplicitNodeTypeConstResourceID,
eImplicitNodeTypeVectorFromScalar,
eImplicitNodeTypeUnsignedMesh,
eImplicitNodeTypeMod
Expand Down Expand Up @@ -10841,7 +10841,7 @@ implementation
eImplicitNodeTypeFunctionCall: Result := 45;
eImplicitNodeTypeMesh: Result := 46;
eImplicitNodeTypeLength: Result := 47;
eImplicitNodeTypeResource: Result := 48;
eImplicitNodeTypeConstResourceID: Result := 48;
eImplicitNodeTypeVectorFromScalar: Result := 49;
eImplicitNodeTypeUnsignedMesh: Result := 50;
eImplicitNodeTypeMod: Result := 51;
Expand Down Expand Up @@ -10900,7 +10900,7 @@ implementation
45: Result := eImplicitNodeTypeFunctionCall;
46: Result := eImplicitNodeTypeMesh;
47: Result := eImplicitNodeTypeLength;
48: Result := eImplicitNodeTypeResource;
48: Result := eImplicitNodeTypeConstResourceID;
49: Result := eImplicitNodeTypeVectorFromScalar;
50: Result := eImplicitNodeTypeUnsignedMesh;
51: Result := eImplicitNodeTypeMod;
Expand Down
2 changes: 1 addition & 1 deletion Autogenerated/Bindings/Python/Lib3MF.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,7 @@ class ImplicitNodeType(CTypesEnum):
FunctionCall = 45
Mesh = 46
Length = 47
Resource = 48
ConstResourceID = 48
VectorFromScalar = 49
UnsignedMesh = 50
Mod = 51
Expand Down
2 changes: 1 addition & 1 deletion Autogenerated/Source/lib3mf_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ namespace Lib3MF {
FunctionCall = 45, /** Calls a function */
Mesh = 46, /** Calculates the signed distance to a mesh */
Length = 47, /** Calculates the length of a vector */
Resource = 48, /** Selects a resource (function, mesh etc.) */
ConstResourceID = 48, /** Selects a resource (function, mesh etc.) */
VectorFromScalar = 49, /** Creates a vector from one scalar values */
UnsignedMesh = 50, /** Calculates the unsigned distance to a mesh */
Mod = 51 /** Calculates the modulo of two values (same behaviour as glsl mod) */
Expand Down
2 changes: 1 addition & 1 deletion AutomaticComponentToolkit/lib3mf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,7 @@
<option name="FunctionCall" description="Calls a function" value="45" />
<option name="Mesh" description="Calculates the signed distance to a mesh" value="46" />
<option name="Length" description="Calculates the length of a vector" value="47" />
<option name="Resource" description="Selects a resource (function, mesh etc.)" value="48" />
<option name="ConstResourceID" description="Selects a resource (function, mesh etc.)" value="48" />
<option name="VectorFromScalar" description="Creates a vector from one scalar values"
value="49" />
<option name="UnsignedMesh" description="Calculates the unsigned distance to a mesh"
Expand Down
2 changes: 1 addition & 1 deletion Source/API/lib3mf_implicitfunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ IResourceIdNode* CImplicitFunction::AddResourceIdNode(
const std::string& sTag)
{
auto newNode =
function()->addNode(Lib3MF::eImplicitNodeType::Resource,
function()->addNode(Lib3MF::eImplicitNodeType::ConstResourceID,
Lib3MF::eImplicitNodeConfiguration::Default,
sIdentifier, sDisplayName, sTag);
return new CResourceIdNode(newNode);
Expand Down
2 changes: 1 addition & 1 deletion Source/API/lib3mf_nodeiterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ IImplicitNode* Lib3MF::Impl::CNodeIterator::implicitNodeFromModelImplicitNode(
return new CUnsignedMeshNode(pNode);
case eImplicitNodeType::Length:
return new CLengthNode(pNode);
case eImplicitNodeType::Resource:
case eImplicitNodeType::ConstResourceID:
return new CResourceIdNode(pNode);
case eImplicitNodeType::Mod:
return new CModNode(pNode);
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Classes/NMR_ImplicitNodeTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ namespace NMR
In{{"A", eImplicitPortType::Scalar}},
Out{{"result", eImplicitPortType::Vector}}},
}}},
{eImplicitNodeType::Resource,
{"resource",
{eImplicitNodeType::ConstResourceID,
{"constresourceid",
{
InputOutputRule{
Lib3MF::eImplicitNodeConfiguration::Default, In{},
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Classes/NMR_Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ namespace NMR {

for (auto & node : *pNewImplicitFunction->getNodes())
{
if (node->getNodeType() == Lib3MF::eImplicitNodeType::Resource)
if (node->getNodeType() == Lib3MF::eImplicitNodeType::ConstResourceID)
{
auto const oldId = pSourceModel->findPackageResourceID(pSourceModel->currentPath(), node->getModelResourceID());
if (!oldId)
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Classes/NMR_ModelImplicitNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,14 @@ namespace NMR

void CModelImplicitNode::setModelResourceID(UniqueResourceID resourceID)
{
if (m_type != Lib3MF::eImplicitNodeType::Resource)
if (m_type != Lib3MF::eImplicitNodeType::ConstResourceID)
throw CNMRException(NMR_ERROR_INVALIDPARAM);
m_modelResourceID = resourceID;
}

UniqueResourceID CModelImplicitNode::getModelResourceID() const
{
if (m_type != Lib3MF::eImplicitNodeType::Resource)
if (m_type != Lib3MF::eImplicitNodeType::ConstResourceID)
throw CNMRException(NMR_ERROR_INVALIDPARAM);

return m_modelResourceID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ namespace NMR
m_pImplicitNode->setMatrix(matFromString(pAttributeValue));
}
}
else if (m_pImplicitNode->getNodeType() == Lib3MF::eImplicitNodeType::Resource)
else if (m_pImplicitNode->getNodeType() == Lib3MF::eImplicitNodeType::ConstResourceID)
{
if (strcmp(pAttributeName, XML_3MF_ATTRIBUTE_IMPLICIT_NODE_RESOURCE_ID) == 0)
{
Expand Down
7 changes: 4 additions & 3 deletions Source/Model/Writer/NMR_ModelWriterNode_Implicit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ namespace NMR
void CModelWriterNode_Implicit::writeImplicitFunctionElements(CModelImplicitFunction & function)
{
writeImplicitFunctionInputs(*function.getInputs());
writeImplicitFunctionOutputs(*function.getOutputs());

for (auto node : *function.getNodes())
{
writeImplicitNode(*node);
}

writeImplicitFunctionOutputs(*function.getOutputs());
}

std::string mat4x4ToString(Lib3MF::sMatrix4x4 const & mat)
Expand Down Expand Up @@ -133,7 +134,7 @@ namespace NMR
auto const mat = node.getMatrix();
writeStringAttribute(XML_3MF_ATTRIBUTE_IMPLICIT_NODE_MATRIX, mat4x4ToString(mat));
}
else if(node.getNodeType() == Lib3MF::eImplicitNodeType::Resource)
else if(node.getNodeType() == Lib3MF::eImplicitNodeType::ConstResourceID)
{
auto resource = node.getResource();
if (resource != nullptr)
Expand All @@ -146,7 +147,7 @@ namespace NMR
bool const isNodeWithoutInputs = node.getNodeType() == Lib3MF::eImplicitNodeType::Constant ||
node.getNodeType() == Lib3MF::eImplicitNodeType::ConstVec ||
node.getNodeType() == Lib3MF::eImplicitNodeType::ConstMat ||
node.getNodeType() == Lib3MF::eImplicitNodeType::Resource;
node.getNodeType() == Lib3MF::eImplicitNodeType::ConstResourceID;

if (!isNodeWithoutInputs) // Certain node types are not allowed to have inputs, but may have been set by the producer
{
Expand Down
Loading