Story: How to define selectable objects in HiStruct 3D scene - HiStructClient/femcad-doc GitHub Wiki

ModelPath and ParameterPath

HiStruct allows contextual selection in the 3D model via mouse cursor. Each such a selection can offer the user to modify a certain input instance object.

ModelPath

Each generated 3D scene of HiStruct is a hierarchical tree of model objects that are nested over a hierarchical schema that is defined by all gblocks and distributions in the scene tree. Each objects is clearly addressable via a unique path that is called ModelPath.

ParameterPath

Similarily each instance of a parametric model value called "frame" is an object whose value is a hierarchical value structure with named properties that have values of other objects or arrays with indices. All values in the tree of "frame" can be referenced by a global ParameterPath.

CmpMap

ModelPath and ParameterPath are both in general different. But if a designer of component template declares the relation between these two, HiStruct allows user to do contextual selection. The entries for

CmpMapFile

The entries for the CmpMap can be described explicitly in a json file that is referenced from the ComponentDefinition .fcscdm property called CmpMapFile.

 "CmpMapFile":         "main_CmpMap.fcscdx",

This is an example of such a file.

[
   {
       "ModelPath": "gbTreePark.dTreeLines[%lineIndex].dTrees[%treeIndex]",
       "ParameterPath": "input.inTreeLinesArray[%lineIndex].inTreeArray[%treeIndex]"
   },
   {
       "ModelPath": "gbTreePark.dTreeLines[%lineIndex].gbLabel",
       "ParameterPath": "input.inTreeLinesArray[%lineIndex]"
   }  
]

The gramatics used in the ModelPath and ParameterPath enables to define contextual relationship between instances of model objects in the scene tree and parameteric input objects in the value frame tree.

CmpMapIdentifier

Newer version of HiStruct enables to describe these relationships via code written in fcs file via femcad script. Refernce to the identifier holding the definition is in the ComponetDefintion file .fcscdm via CmpMapIdentifier property

"CmpMapIdentifier":   "cmpMapIdentifier"

The value will be searched for in the script file refenced via "FcsScript" property or "SharedTypeDescriptionsFcsScript" in the .fcscdm

Example is here

  cmpMapIdentifier := [
     Fcs.Definition.CmpMapEntry{
        ModelPath="gbTreePark.dTreeLines[%lineIndex].dTrees[%treeIndex]",
        ParameterPath="input.inTreeLinesArray[%lineIndex].inTreeArray[%treeIndex]"
     },
     Fcs.Definition.CmpMapEntry{
        ModelPath="gbTreePark.dTreeLines[%lineIndex].gbLabel",
        ParameterPath="input.inTreeLinesArray[%lineIndex]"
     }  
  ]