CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
TrVisSectionDef.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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// Viewport clipping and sectioning definition
24
25#ifndef ODTRVISSECTIONDEF
26#define ODTRVISSECTIONDEF
27
28#include "TD_PackPush.h"
29
30#include "TrVisDefs.h"
31#include "Ps/PlotStyles.h"
32
37{
38 // Flags
39 enum Flags
40 {
41 // Enable sections filling.
42 kEnableFilling = (1 << 0),
43 // Enable sections stippling pattern.
45 };
46 // Sectioning flags
48 // Number of fixed clipping planes
50 // Array of section planes
52 // Sections filling color
54 // Sections filling pattern color
56 // Sections filling pattern
58
59 void resetFlags(OdUInt16 nFlags = 0)
60 {
61 m_flags = nFlags;
62 }
64 {
65 resetFlags();
67 m_planes.setPhysicalLength(0);
68 m_color = 0xFFFFFFFF;
69 m_stippleColor = 0xFF000000;
71 }
72
73 void enableFilling(bool bSet) { SETBIT(m_flags, kEnableFilling, bSet); }
74 bool isFillingEnabled() const { return GETBIT(m_flags, kEnableFilling); }
75
76 void enableStippling(bool bSet) { SETBIT(m_flags, kEnableStippling, bSet); }
78
79 void setSectionPlanes(const OdTrVisSectionPlaneArray &aPlanes) { m_planes = aPlanes; }
81
82 void appendSectionPlane(const OdTrVisSectionPlane &pPlane) { m_planes.push_back(pPlane); }
83 void clearSectionPlanes() { m_planes.clear(); }
84
85 bool hasSectionPlanes() const { return !m_planes.isEmpty(); }
86 bool isClippingEnabled() const { return hasSectionPlanes(); }
87
88 bool hasFixedPlanes() const { return m_numFixedPlanes > 0; }
90
91 OdUInt32 numSectionPlanes() const { return (OdUInt32)m_planes.size(); }
92 const OdTrVisSectionPlane &sectionPlane(OdUInt32 nPlane) const { return m_planes.getPtr()[nPlane]; }
93
94 void setFillColor(ODCOLORREF color) { m_color = color; }
95 ODCOLORREF fillColor() const { return m_color; }
96
97 bool fillColorTransparent() const { return ODGETALPHA(m_color) < 0xFF; }
98 bool fillColorInvisible() const { return ODGETALPHA(m_color) == 0; }
99
102
103 void setStipplePattern(OdUInt8 pattern) { m_stipplePattern = pattern; }
105
107 void setStipplePattern(OdPs::FillStyle fillStyle, ODCOLORREF color) { setStipplePattern(fillStyle); m_stippleColor = color; }
108};
109
110#include "TD_PackPop.h"
111
112#endif // ODTRVISSECTIONDEF
#define ODCOLORREF
#define ODGETALPHA(rgba)
unsigned int OdUInt32
unsigned short OdUInt16
unsigned char OdUInt8
#define SETBIT(flags, bit, value)
Definition OdaDefs.h:516
#define GETBIT(flags, bit)
Definition OdaDefs.h:517
OdArray< OdTrVisSectionPlane, OdMemoryAllocator< OdTrVisSectionPlane > > OdTrVisSectionPlaneArray
Definition TrVisDefs.h:268
FillStyle
Definition PlotStyles.h:53
@ kFsSolid
Definition PlotStyles.h:54
bool isClippingEnabled() const
bool isFillingEnabled() const
void setStippleColor(ODCOLORREF color)
void resetFlags(OdUInt16 nFlags=0)
ODCOLORREF m_stippleColor
void setStipplePattern(OdUInt8 pattern)
ODCOLORREF fillColor() const
const OdTrVisSectionPlane & sectionPlane(OdUInt32 nPlane) const
OdTrVisSectionPlaneArray m_planes
void setStipplePattern(OdPs::FillStyle fillStyle, ODCOLORREF color)
void enableStippling(bool bSet)
void appendSectionPlane(const OdTrVisSectionPlane &pPlane)
void enableFilling(bool bSet)
const OdTrVisSectionPlaneArray & sectionPlanes() const
OdUInt32 numSectionPlanes() const
void setFillColor(ODCOLORREF color)
bool hasSectionPlanes() const
OdUInt8 stipplePattern() const
bool hasFixedPlanes() const
bool fillColorInvisible() const
ODCOLORREF stippleColor() const
OdUInt32 numFixedPlanes() const
bool fillColorTransparent() const
bool isStipplingEnabled() const
void setSectionPlanes(const OdTrVisSectionPlaneArray &aPlanes)
void setStipplePattern(OdPs::FillStyle fillStyle)