Hi Farhan
They would be custom user properties that I am setting myself in a previous stage of processing models. I would potentially like to be able to query any custom user defined properties so I don’t need to keep track of all properties that may be used.
Example of a property I am using:
sceneNode.SetProperty( "Category", "Structural");
sceneNode.SetProperty( "CAD.Material", "Steel");
sceneNode.SetProperty( "CAD.PartNumber", "111111111");
// SetFlags( PropertyFlags.UserDefined, true ); for all of the above properties
Lets say this was done in a custom exporter for a CAD program. If I write a separate tool that moves the models into new scenes based on Category, I can look for the “Category” property and that is no issue since I know about it. The issue is when I want to copy the other properties into the scene without having to list every single one.
For example:
Scene structuralScene = new Scene();
// Check all node in the input scene for "Structural" ones
input.RootNode.Accept( sourceNode =>
{
Geometry g = sourceNode.GetEntity<Geometry>();
if ( g == null )
return true;
string categoryValue = sourceNode.GetProperty( "Category" )?.ToString();
if ( categoryValue != "Structural" )
return true;
// We have a node to copy into the structuralScene
Node targetNode = CreateCopyOfNodeAndAncestors( targetScene: structuralScene, sourceScene: input, sourceNode: sourceNode );
// The above just creates a new Node instance in structuralScene
// Now we want to copy all properties over that were on the node
// It cant be done currently
IReadOnlyList<Property> properties = sourceNode.GetProperties();
foreach( Property property in properties )
targetNode.SetProperty( property.Name, property.Value );
return true;
} );
Are there any implications of adding a GetProperties method?