There are three modes that are used for building a CDA tree:
The createDatabaseHierarchyTree()
function of the
OdRxModelHierarchyTreeBase
class is used to build a hierarchical
tree structure. The function returns a smart pointer to the root node of the
hierarchical tree.
virtual OdRxModelTreeBaseNodePtr createDatabaseHierarchyTree(const OdRxObject* pDb,
const bool create_properties_cache = true,
const bool class_dependent_hierarchy = false,
const bool class_dependent_property = false);
virtual OdRxModelTreeBaseNodePtr createDatabaseHierarchyTree(const OdRxObject* pDb,
const std::set* collected_properties,
const bool class_dependent_hierarchy = false,
const bool class_dependent_property = false);
Arguments:
pDb
— Pointer to the source database object.create_properties_cache
— Flag to create a cache of
properties. Default value is true.
collected_properties
— A pointer to a set of property
names to be added to the cache. If NULL, all properties are
cached.
class_dependent_hierarchy
— Flag to optimize the creation
of a hierarchical tree. Set to true if the properties of
database objects with a hierarchical attribute are statically dependent on
the object type. Default value is false.
class_dependent_property
— Flag to optimize cache
creation. Set to true only if all properties of database objects
are statically dependent on the object type. Default value is false.
Note: The
class_dependent_hierarchy
and
class_dependent_property
flags allow you to optimize performance of the methods only under the following conditions:
class_dependent_hierarchy
— Properties containing
a hierarchical attribute statically depend on the object type.
class_dependent_property
— All properties of the
object statically depend on the object type.
Table of flags that are available for each file format and product:
.dwg | DGN | IFC | BimNv | BimRv | |
---|---|---|---|---|---|
class_dependent_hierarchy | + | + | + | + | - |
class_dependent_property | + | + | - | + | - |
Below is an example of obtaining a hierarchical tree with the full set of properties.
OdRxModelHierarchyTreeBasePtr pHierarchyTreeBase = OdRxModelHierarchyTreeBase::createObject();
OdRxModelTreeBaseNodePtr pTree = pHierarchyTreeBase->createDatabaseHierarchyTree(pDb, true);
Where pTree
is a pointer to the root node of the CDA
hierarchical tree of the database.
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|