CFx SDK Documentation  2023 SP0
AECCustomRailingRepresentation.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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 
24 #ifndef __AECCUSTOMRAILINGREPRESENTATION_H__
25 #define __AECCUSTOMRAILINGREPRESENTATION_H__
26 
28 
34 class AECARCHBASE_API AECCustomRailingRepresentation : public AECDispCompEnt
35 {
37 
38  public:
42  enum AttachTo
43  {
44  eAll = 0,
45  eFirst = 1,
46  eLast = 2,
47  eSelection = 3,
48  };
49 
53  enum XPosition
54  {
55  eXCenter = 0,
56  eXLeft = 1,
57  eXRight = 2,
58  };
59 
63  enum YPosition
64  {
65  eYCenter = 0,
66  eYFront = 1,
67  eYBack = 2,
68  };
69 
73  enum ZPosition
74  {
75  eZBottom = 0,
76  eZMiddle = 1,
77  eZTop = 2,
78  };
79 
80  public:
84  bool IsScaleToFitWidth() const;
85 
89  void SetIsScaleToFitWidth( bool bScale );
90 
94  bool IsScaleToFitDepth() const;
95 
99  void SetIsScaleToFitDepth( bool bScale );
100 
105 
109  void SetIsScaleToFitLockXYRatio( bool bScale );
110 
114  bool IsBetweenComps() const;
115 
119  void SetIsBetweenComps( bool bBetween );
120 
125 
129  void SetXPosition( XPosition ePosition );
130 
135 
139  void SetYPosition( YPosition ePosition );
140 
144  bool IsMirrorX() const;
145 
149  void SetIsMirrorX( bool bMirror );
150 
154  bool IsMirrorY() const;
155 
159  void SetIsMirrorY( bool bMirror );
160 
164  bool IsReplace() const;
165 
169  void SetIsReplace( bool bReplace );
170 
174  bool IsHandrailComponent() const;
175 
179  void SetIsHandrailComponent( bool bOn );
180 
184  bool IsGuardrailComponent() const;
185 
189  void SetIsGuardrailComponent( bool bOn );
190 
194  bool IsBottomrailComponent() const;
195 
199  void SetIsBottomrailComponent( bool bOn );
200 
204  bool IsFixedPostComponent() const;
205 
209  void SetIsFixedPostComponent( bool bOn );
210 
215 
219  void SetIsDynamicPostComponent( bool bOn );
220 
224  bool IsBalusterComponent() const;
225 
229  void SetIsBalusterComponent( bool bOn );
230 
235 
239  void SetAttachTo( AttachTo eType );
240 
249 
257  void SetSelectionStart( OdUInt16 iIndex );
258 
267 
275  void SetSelectionEnd( OdUInt16 iIndex );
276 
284  double GetZRotation() const;
285 
293  void SetZRotation( double dRotation );
294 
295  public:
302  bool IsSkippedComponent( OdUInt32 iOverall, OdUInt32 iIndex ) const;
303  bool IsDrawnForComponent( OdUInt32 iOverall, OdUInt32 iIndex ) const;
304 
305  protected:
307  // This union represents internal structure of 32-bit flag containter.
308  //
309  // o m_iScaleDepth, m_iScaleWidth and m_iScaleHeight indicate if custom block should be scaled to fit certain dimension.
310  // o m_iLockRatio indicates whether scaling ratio should be locked. It is disabled if only one flag is selected. Lock ratio disables other scaling parameters and between comp parameter.
311  // o m_iBetweenComp is enabled only if block is attached to baluster or any post. Between comp disables scale to fit depth and enables lock ratio.
312  // o m_iXAnchor has the following values: 1 for "left", 0 for "center", 2 for "right"
313  // o m_iYAnchor has the following values: 1 for "front", 0 for "center", 2 for "back"
314  // o m_iZAnchor has the following values: 0 for "bottom", 1 for "middle", 2 for "top"
315  // o m_iMirrorX, m_iMirrorY and m_iMirrorZ have boolean-like behaviour
316  // o m_iAlignSlope enables m_iShear and m_iUseOrigin
317  // o m_iShear disables m_iUseOrigin
318  // o m_iUseOrigin does not affect anything
319  // o m_iReplace indicates if selected custom block should replace selected components
320  //
322  {
324  struct
325  {
326 #ifdef ODA_BIGENDIAN
327  OdUInt32 m_iReserved :14;
328  OdUInt32 m_iReplace : 1;
329  OdUInt32 m_iUseOrigin : 1;
330  OdUInt32 m_iShear : 1;
331  OdUInt32 m_iAlignSlope : 1;
332  OdUInt32 m_iMirrorZ : 1;
333  OdUInt32 m_iMirrorY : 1;
334  OdUInt32 m_iMirrorX : 1;
335  OdUInt32 m_iZAnchor : 2;
336  OdUInt32 m_iYAnchor : 2;
337  OdUInt32 m_iXAnchor : 2;
338  OdUInt32 m_iBetweenComps : 1;
339  OdUInt32 m_iLockRatio : 1;
340  OdUInt32 m_iScaleHeight : 1;
341  OdUInt32 m_iScaleWidth : 1;
342  OdUInt32 m_iScaleDepth : 1;
343 #else
360 #endif
361  } m_bBits;
362  };
363 
365  // This union represents internal structure of 16-bit flag container. Theese
366  // flags define railing components custom block is attached to. Custom block can
367  // be attached only to one type components: either to railings or to posts and balusters.
369  {
371  struct
372  {
373 #ifdef ODA_BIGENDIAN
374  OdUInt16 m_iReserved :10;
375  OdUInt16 m_iBaluster : 1;
376  OdUInt16 m_iDynamicPost : 1;
377  OdUInt16 m_iMainPost : 1;
378  OdUInt16 m_iBottomrail : 1;
379  OdUInt16 m_iGuardrail : 1;
380  OdUInt16 m_iHandrail : 1;
381 #else
389 #endif
390  } m_bBits;
391  };
392 
393  protected:
394  // This value stores general flags.
396 
397  // Guess: this value should store position.
399 
400  // This is enum-like value, that stores "attach to" setting.
401  // In DXF stream it is stored as 16-bit integer.
403 
404  // This is selection start for an appropriate "attach to" value.
406 
407  // This is selection end for an appropriate "attach to" value.
409 
410  // This value stores rotate-z angle.
411  double m_dRotateZ;
412 };
413 
416 
417 #endif // __AECCUSTOMRAILINGREPRESENTATION_H__
AECSubPtr< AECCustomRailingRepresentation > AECCustomRailingRepresentationSubPtr
OdSmartPtr< AECCustomRailingRepresentation > AECCustomRailingRepresentationPtr
#define AEC_DECLARE_MEMBERS(ClassName)
Definition: AECMacros.h:54
unsigned int OdUInt32
unsigned short OdUInt16
void SetIsScaleToFitLockXYRatio(bool bScale)
void SetIsDynamicPostComponent(bool bOn)
void SetIsHandrailComponent(bool bOn)
void SetSelectionEnd(OdUInt16 iIndex)
void SetIsMirrorY(bool bMirror)
void SetIsScaleToFitDepth(bool bScale)
void SetSelectionStart(OdUInt16 iIndex)
void SetIsScaleToFitWidth(bool bScale)
OdUInt16 GetSelectionStart() const
void SetIsGuardrailComponent(bool bOn)
XPosition GetXPosition() const
OdUInt16 GetSelectionEnd() const
void SetXPosition(XPosition ePosition)
YPosition GetYPosition() const
void SetIsBottomrailComponent(bool bOn)
void SetIsBetweenComps(bool bBetween)
void SetIsMirrorX(bool bMirror)
void SetIsFixedPostComponent(bool bOn)
bool IsSkippedComponent(OdUInt32 iOverall, OdUInt32 iIndex) const
void SetZRotation(double dRotation)
void SetYPosition(YPosition ePosition)
bool IsDrawnForComponent(OdUInt32 iOverall, OdUInt32 iIndex) const
void SetIsBalusterComponent(bool bOn)
void SetAttachTo(AttachTo eType)
void SetIsReplace(bool bReplace)