This class represents a set of layer information, such as their name and identifier, as well as a list of layer filters.
.
More...
Inheritance diagram for Dtk_LayerInfosSet:Data Structures | |
| struct | Layer |
Public Member Functions | |
| Dtk_ErrorStatus | AddLayer (Layer inLayer) |
| Adds a layer in the set. More... | |
| Dtk_LayerFilterInfosPtr | CreateLayerFilterInfos (Dtk_string inName=L"", Dtk_string inDescription=L"", const Dtk_bool inAreLayersSelectedByDefault=DTK_FALSE, const Dtk_bool IsDefaultLayerFilter=DTK_FALSE) |
| Creates a layer filter. More... | |
| Dtk_Int32 | DtkDynamicType (const Dtk_Int32 &inId) |
| Retrieves the dynamic entity type. More... | |
| virtual int | DtkDynamicType (const int &inId)=0 |
| virtual void | dump (FILE *file=stdout) |
| type_detk | get_type_detk () const |
| Dtk_ErrorStatus | GetCurrentLayer (Dtk_Size_t &outCurrentLayerIndex) const |
| Gets the current layer index. More... | |
| Dtk_ErrorStatus | GetDefaultLayerFilter (Dtk_Size_t &outDefaultLayerFilterIndex) const |
| Gets the default layer filter index. More... | |
| Dtk_ErrorStatus | GetLayerByID (Dtk_ID inLayerID, Layer &out) |
| Retrieves a layer in the set using its identifier. More... | |
| Dtk_LayerFilterInfosPtr | GetLayerFilterByPos (const Dtk_Size_t inLayerFilterIndex) const |
| Gets a layer filter giving its index. More... | |
| dtk::Span< Layer const > | GetLayers () const |
| Retrieves layers in the set as a dtk::Span. More... | |
| Dtk_tab< Dtk_ID > | GetLayersFlaggedAs (Dtk_LayerInfosSet::Layer::Status inStatus) const |
| Retrieves the identifiers of layers in the set that are flagged a certain way. More... | |
| Dtk_Size_t | GetNumLayerFilters () const |
| Retrieves the number of layer filters. More... | |
| Dtk_Size_t | GetNumLayers () const |
| Retrieves the number of layers. More... | |
| virtual Dtk_Size_t | GetSize () const |
| SetAsDeprecated ("v2026.2", "Use AddLayer instead.") Dtk_ErrorStatus SetLayerName(const Dtk_Size_t inIndex | |
| Sets the layer name giving its index. More... | |
| SetAsDeprecated ("v2026.2", "Use Create then Dtk_LayerInfoSet::AddLayers instead.") static Dtk_LayerInfosSetPtr Create(const Dtk_Size_t inNumLayers) | |
| Calls a constructor to allocate a new object. More... | |
| SetAsDeprecated ("v2026.2", "Use GetCurrentLayer instead.") Dtk_ErrorStatus GetDefaultLayer(Dtk_Size_t &outDefaultLayerIndex) const | |
| Gets the default layer index. More... | |
| SetAsDeprecated ("v2026.2", "Use GetLayerByID instead.") Dtk_ErrorStatus GetLayerNameById(const Dtk_ID inLayerID | |
| Gets the LayerName giving the ID found by infos->GetLayer(). More... | |
| SetAsDeprecated ("v2026.2", "Use GetLayers instead.") Dtk_ErrorStatus GetLayerID(const Dtk_Size_t inLayerIndex | |
| Gets the LayerID giving its index. More... | |
| SetAsDeprecated ("v2026.2", "Use GetLayers instead.") Dtk_ErrorStatus GetLayerName(const Dtk_Size_t inIndex | |
| Gets the LayerName giving its index. More... | |
| SetAsDeprecated ("v2026.2", "Use GetLayers instead.") Dtk_ErrorStatus SetLayerID(const Dtk_Size_t inLayerIndex | |
| Sets the LayerID giving its index. More... | |
| SetAsDeprecated ("v2026.2", "Use SetCurrentLayer instead.") Dtk_ErrorStatus SetDefaultLayer(const Dtk_Size_t inDefaultLayerIndex) | |
| Sets the default layer index. More... | |
| Dtk_ErrorStatus | SetCurrentLayer (const Dtk_Size_t inCurrentLayerIndex) |
| Sets the current layer index. More... | |
Static Public Member Functions | |
| static Dtk_LayerInfosSetPtr | Create () |
| Calls default constructor to allocate a new object. More... | |
| static Dtk_LayerInfosSet * | DtkDynamicCast (Dtk_Object *s) |
| Performs a dynamic cast - doesn't need RTTI -. More... | |
Data Fields | |
| Dtk_string &outLayerName | const |
| Dtk_ID &outLayerID | const |
| const Dtk_ID & | inLayerID |
| const Dtk_string & | inLayerName |
Protected Types | |
| enum | { _typeID = DTK_TYPE_OBJECT } |
| enum | { _typeID = DTK_TYPE_LAYER_INFOS_SET } |
Protected Member Functions | |
| virtual Dtk_Object * | Clone () |
| Dtk_LayerInfosSet () | |
| Dtk_LayerInfosSet (const Dtk_LayerInfosSet &s) | |
| Copy constructor. More... | |
| Dtk_LayerInfosSet (Dtk_LayerInfosSet &&s) DTK_NOEXCEPT | |
| Move constructor. More... | |
| ~Dtk_LayerInfosSet () | |
| Destructor. More... | |
Protected Attributes | |
| Dtk_Handle * | _Private |
| unsigned long | count_ |
This class represents a set of layer information, such as their name and identifier, as well as a list of layer filters.
.
The set allows to extend the definition of legacy layers, that previously were only represented by an identifier. It lists all layers used in a given context (Dtk_Component), and allows to assign a name to each of them.
It also allows to define one of the layer as being the default one (note that this can be the same concept as the current one, depending on the format).
Creation of layer filters are also done through this set, representing a group of specific layers.
One of the filter can be defined as being the default one, similarly to individual layer.
|
protected |
|
protected |
Copy constructor.
| s | Object to copy from. |
|
protected |
Move constructor.
| s | Object to move from. |
|
protected |
Destructor.
| Dtk_ErrorStatus Dtk_LayerInfosSet::AddLayer | ( | Layer | inLayer | ) |
Adds a layer in the set.
| [in] | inLayer | the layer to be added. The Dtk_LayerInfoSet expects layer being added to have an initialized identifier ( with a value different from static_cast< Dtk_ID >( -1 ) ). If the layer identifier is uninitialized, this function will set the identifier as being the layer index in the layer set. |
|
protectedvirtual |
|
static |
Calls default constructor to allocate a new object.
| Dtk_LayerFilterInfosPtr Dtk_LayerInfosSet::CreateLayerFilterInfos | ( | Dtk_string | inName = L"", |
| Dtk_string | inDescription = L"", |
||
| const Dtk_bool | inAreLayersSelectedByDefault = DTK_FALSE, |
||
| const Dtk_bool | IsDefaultLayerFilter = DTK_FALSE |
||
| ) |
Creates a layer filter.
| [in] | inName | the layer filter name - Empty name by default -. |
| [in] | inDescription | the layer filter description - Empty name by default -. |
| [in] | inAreLayersActivatedByDefault | The default value of the layer selection. DTK_TRUE means that all layers are selected. DTK_FALSE means that no layer is selected - DTK_FALSE by default -. |
| [in] | IsDefaultLayerFilter | Tells if the new layer filter is the default one - DTK_FALSE by default -. |
|
static |
Performs a dynamic cast - doesn't need RTTI -.
Retrieves the dynamic entity type.
|
pure virtualinherited |
Implemented in Dtk_Shell, Dtk_Body, Dtk_Lump, Dtk_Volume, Dtk_Face, Dtk_Loop, Dtk_Coedge, Dtk_Edge, Dtk_Vertex, Dtk_TopologicalEntity, Dtk_MeshPolyline, Dtk_MeshSurface, Dtk_TransformedSurface, Dtk_FilletSurface, Dtk_OffsetSurface, Dtk_SphericalSurface, Dtk_ToroidalSurface, Dtk_ConicalSurface, Dtk_CylindricalSurface, Dtk_RuledSurface, Dtk_LinearExtrusionSurface, Dtk_StandardRevolutionSurface, Dtk_RevolutionSurface, Dtk_PlaneSurface, Dtk_NurbsSurface, Dtk_Surface, Dtk_Hyperbola, Dtk_Parabola, Dtk_Ellipse, Dtk_Conic, Dtk_Line, Dtk_Polyline, Dtk_NurbsCurve, Dtk_Curve, Dtk_Point, Dtk_Constraint, Dtk_ConstraintReference, Dtk_AxisSystem, Dtk_Preview, Dtk_Entity, Dtk_picture, Dtk_OverrideSet, Dtk_OverrideInfo, Dtk_MainDoc, Dtk_Component, Dtk_Node, Dtk_DocElement, Dtk_Log, and Dtk_Properties.
|
virtualinherited |
| type_detk Dtk_LayerInfosSet::get_type_detk | ( | ) | const |
| Dtk_ErrorStatus Dtk_LayerInfosSet::GetCurrentLayer | ( | Dtk_Size_t & | outCurrentLayerIndex | ) | const |
Gets the current layer index.
| outCurrentLayerIndex | the layer index or -1 if any error. |
| Dtk_ErrorStatus Dtk_LayerInfosSet::GetDefaultLayerFilter | ( | Dtk_Size_t & | outDefaultLayerFilterIndex | ) | const |
Gets the default layer filter index.
| outDefaultLayerFilterIndex | the layer filter index or -1 if any error. |
| Dtk_ErrorStatus Dtk_LayerInfosSet::GetLayerByID | ( | Dtk_ID | inLayerID, |
| Layer & | out | ||
| ) |
Retrieves a layer in the set using its identifier.
| [in] | inLayerID | the layer identifier. |
| [out] | out | the layer with the provided identifier if found. |
| Dtk_LayerFilterInfosPtr Dtk_LayerInfosSet::GetLayerFilterByPos | ( | const Dtk_Size_t | inLayerFilterIndex | ) | const |
Gets a layer filter giving its index.
| inLayerFilterIndex | the layer filter index. |
| Dtk_tab< Dtk_ID > Dtk_LayerInfosSet::GetLayersFlaggedAs | ( | Dtk_LayerInfosSet::Layer::Status | inStatus | ) | const |
Retrieves the identifiers of layers in the set that are flagged a certain way.
| [in] | inStatus | the flag to check to retrieve layers identifiers. |
| Dtk_Size_t Dtk_LayerInfosSet::GetNumLayerFilters | ( | ) | const |
Retrieves the number of layer filters.
| Dtk_Size_t Dtk_LayerInfosSet::GetNumLayers | ( | ) | const |
Retrieves the number of layers.
|
virtualinherited |
Reimplemented in Dtk_Shell, Dtk_Body, Dtk_Lump, Dtk_Volume, Dtk_Face, Dtk_Loop, Dtk_Coedge, Dtk_Edge, Dtk_Vertex, Dtk_mesh_face, Dtk_mesh, Dtk_TransformedSurface, Dtk_FilletSurface, Dtk_OffsetSurface, Dtk_SphericalSurface, Dtk_ToroidalSurface, Dtk_ConicalSurface, Dtk_CylindricalSurface, Dtk_RuledSurface, Dtk_LinearExtrusionSurface, Dtk_StandardRevolutionSurface, Dtk_RevolutionSurface, Dtk_PlaneSurface, Dtk_NurbsSurface, Dtk_Surface, Dtk_Hyperbola, Dtk_Parabola, Dtk_Ellipse, Dtk_Conic, Dtk_Line, Dtk_Polyline, Dtk_NurbsCurve, Dtk_Curve, Dtk_Point, Dtk_Entity, and Dtk_Info.
| Dtk_LayerInfosSet::SetAsDeprecated | ( | "v2026.2" | , |
| "Use AddLayer instead." | |||
| ) | const |
Sets the layer name giving its index.
| [in] | inIndex | the layer index. |
| [in] | inLayerName | the layer name. |
| Dtk_LayerInfosSet::SetAsDeprecated | ( | "v2026.2" | , |
| "Use Create then Dtk_LayerInfoSet::AddLayers instead." | |||
| ) | const |
Calls a constructor to allocate a new object.
| [in] | inNumLayers | the number of desired layers. The desired number of layer will be added in the set using AddLayer( Layer ). Layers identifier will be set as their index in the set. |
| Dtk_LayerInfosSet::SetAsDeprecated | ( | "v2026.2" | , |
| "Use GetCurrentLayer instead." | |||
| ) | const & |
Gets the default layer index.
| outDefaultLayer | the layer index or -1 if any error. |
| Dtk_LayerInfosSet::SetAsDeprecated | ( | "v2026.2" | , |
| "Use GetLayerByID instead." | |||
| ) | const |
Gets the LayerName giving the ID found by infos->GetLayer().
| [in] | inLayerID | the layer ID. |
| [out] | outLayerName | the layer name or empty string if any error. |
| Dtk_LayerInfosSet::SetAsDeprecated | ( | "v2026.2" | , |
| "Use GetLayers instead." | |||
| ) | const |
Gets the LayerID giving its index.
| [in] | inLayerPos | the layer index. |
| [out] | outLayerID | the layer id or inLayerPos if not given. |
| Dtk_LayerInfosSet::SetAsDeprecated | ( | "v2026.2" | , |
| "Use GetLayers instead." | |||
| ) | const |
Gets the LayerName giving its index.
| [in] | inLayerPos | the layer index. |
| [out] | outLayerName | the layer name or empty string if any error. |
| Dtk_LayerInfosSet::SetAsDeprecated | ( | "v2026.2" | , |
| "Use GetLayers instead." | |||
| ) | const |
Sets the LayerID giving its index.
| [in] | inLayerPos | the layer index. |
| [in] | inLayerID | the layer id. |
| Dtk_LayerInfosSet::SetAsDeprecated | ( | "v2026.2" | , |
| "Use SetCurrentLayer instead." | |||
| ) | const |
Sets the default layer index.
| inDefaultLayer | the layer index. |
| Dtk_ErrorStatus Dtk_LayerInfosSet::SetCurrentLayer | ( | const Dtk_Size_t | inCurrentLayerIndex | ) |
Sets the current layer index.
| inCurrentLayerIndex | the layer index. |
|
protected |
| Dtk_string &outLayerName Dtk_LayerInfosSet::const |
| Dtk_ID& outLayerID Dtk_LayerInfosSet::const |
|
protectedinherited |
| const Dtk_string& Dtk_LayerInfosSet::inLayerName |