CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrVisPropertyDef.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23// Rendition interface property definition.
24
25#ifndef ODTRVISPROPERTYDEF
26#define ODTRVISPROPERTYDEF
27
28#include "TD_PackPush.h"
29
30#include "TrVisDefs.h"
31#include "Ge/GeMatrix3d.h"
32
33// Main property interface
34
39{
41 {
51 // Number of property types
55 {
56 kBooleanProperty = 0, // Boolean
57 kIdProperty, // 64bit numeric
58 kStringProperty, // String
59 kMatrixProperty, // 4x4 doubles
60 // Number of underlying data types
62 };
65 {
66 switch (m_propType)
67 {
68 case kOwningProperty: return kIdProperty;
70 case kLayerProperty: return kIdProperty;
71 case kHlBranchProperty: return kIdProperty;
72 case kVsBranchProperty: return kIdProperty;
74 case kSelStyleProperty: return kIdProperty;
75 case kNameProperty: return kStringProperty;
77 default: return kNumDataTypes;
78 }
79 }
80 protected:
82 : m_propType(propType) {}
83};
84
85// Property data types
86
91{
93 bool propertyValue() const { return m_boolVal; }
94 protected:
96 : OdTrVisPropertyDef(propType), m_boolVal(bVal) {}
97};
98
103{
105 OdTrVisId propertyValue() const { return m_idVal; }
106 protected:
108 : OdTrVisPropertyDef(propType), m_idVal(idVal) {}
109};
110
115{
117 const OdString &propertyValue() const { return m_charVal; }
118 protected:
120 : OdTrVisPropertyDef(propType), m_charVal(charVal) {}
121};
122
127{
129 const OdGeMatrix3d &propertyValue() const { return m_mtxVal; }
130 protected:
132 : OdTrVisPropertyDef(propType), m_mtxVal(mtxVal) {}
133};
134
135// Final property interfaces
136
141{
145};
146
151{
154};
155
160{
164};
165
171{
173 : OdTrVisIdPropertyDef(branchTypeToPropertyType(branchType), (OdTrVisId)branchId) {}
176 { return (PropertyType)(kHlBranchProperty + branchType); }
178 { return (OdTrVisStateBranchType)(propType - kHlBranchProperty); }
184};
185
190{
194};
195
200{
204};
205
210{
213};
214
219{
220 OdTrVisSysDefaultPropertyDef(bool bSystemDefault = true)
222};
223
227template <typename BasicType>
229{
230 protected:
231 BasicType m_value;
233 public:
234 OdTrVisPropertyChangedMonitor(const BasicType &initialState)
235 : m_value(initialState), m_bChanged(false) { }
236 void resetValue(const BasicType &newValue, bool bSetChanged = true)
237 {
238 if (bSetChanged)
239 {
240 if (m_value != newValue)
241 {
242 m_value = newValue;
243 m_bChanged = true;
244 }
245 else
246 m_bChanged = false;
247 }
248 else
249 {
250 m_value = newValue;
251 m_bChanged = false;
252 }
253 }
254 bool isChanged() const { return m_bChanged; }
255 void setNoChange() { m_bChanged = false; }
256 const BasicType &value() const { return m_value; }
257};
258
259#include "TD_PackPop.h"
260
261#endif // ODTRVISPROPERTYDEF
false
Definition: DimVarDefs.h:165
unsigned int OdUInt32
OdTrVisStateBranchType
Definition: TrVisDefs.h:155
@ kTrVisHighlightingBranch
Definition: TrVisDefs.h:156
void resetValue(const BasicType &newValue, bool bSetChanged=true)
OdTrVisPropertyChangedMonitor(const BasicType &initialState)
const BasicType & value() const
OdTrVisBooleanPropertyDef(PropertyType propType, bool bVal)
OdTrVisId propertyValue() const
OdTrVisIdPropertyDef(PropertyType propType, OdTrVisId idVal)
OdTrVisLayerId propertyValue() const
OdTrVisLayerPropertyDef(OdTrVisLayerId layerId)
const OdGeMatrix3d & propertyValue() const
OdTrVisMatrixPropertyDef(PropertyType propType, const OdGeMatrix3d &mtxVal)
OdTrVisNamePropertyDef(const OdString &nameProp)
OdTrVisOwningPropertyDef(OdTrVisOwning owningPropVal)
OdTrVisOwning propertyValue() const
UnderlyingDataType underlyingDataType() const
PropertyType propertyType() const
enum OdTrVisPropertyDef::PropertyType m_propType
OdTrVisPropertyDef(PropertyType propType)
OdUInt32 propertyValue() const
OdTrVisSelStylePropertyDef(OdUInt32 selStyleIndex)
OdTrVisStateBranchId propertyValue() const
static PropertyType branchTypeToPropertyType(OdTrVisStateBranchType branchType)
static OdTrVisStateBranchType propertyTypeToBranchType(PropertyType propType)
OdTrVisStateBranchPropertyDef(OdTrVisStateBranchId branchId, OdTrVisStateBranchType branchType=kTrVisHighlightingBranch)
const OdString & propertyValue() const
OdTrVisStringPropertyDef(PropertyType propType, const OdString &charVal)
OdTrVisSysDefaultPropertyDef(bool bSystemDefault=true)
OdTrVisVisualStylePropertyDef(OdTrVisVisualStyleId visualStyleId)
OdTrVisVisualStyleId propertyValue() const
OdTrVisXformPropertyDef(const OdGeMatrix3d &xformMatrix)