CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrVisSectionDef.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// 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.
44 kEnableStippling = (1 << 1)
45 };
46 // Sectioning flags
48 // Array of section planes
50 // Sections filling color
52 // Sections filling pattern color
54 // Sections filling pattern
56
57 void resetFlags(OdUInt16 nFlags = 0)
58 {
59 m_flags = nFlags;
60 }
62 {
63 resetFlags();
65 m_color = 0xFFFFFFFF;
66 m_stippleColor = 0xFF000000;
68 }
69
70 void enableFilling(bool bSet) { SETBIT(m_flags, kEnableFilling, bSet); }
71 bool isFillingEnabled() const { return GETBIT(m_flags, kEnableFilling); }
72
73 void enableStippling(bool bSet) { SETBIT(m_flags, kEnableStippling, bSet); }
75
76 void setSectionPlanes(const OdTrVisSectionPlaneArray &aPlanes) { m_planes = aPlanes; }
78
81
82 bool hasSectionPlanes() const { return !m_planes.isEmpty(); }
83 bool isClippingEnabled() const { return hasSectionPlanes(); }
84
86 const OdTrVisSectionPlane &sectionPlane(OdUInt32 nPlane) const { return m_planes.getPtr()[nPlane]; }
87
88 void setFillColor(ODCOLORREF color) { m_color = color; }
89 ODCOLORREF fillColor() const { return m_color; }
90
91 bool fillColorTransparent() const { return ODGETALPHA(m_color) < 0xFF; }
92 bool fillColorInvisible() const { return ODGETALPHA(m_color) == 0; }
93
94 void setStippleColor(ODCOLORREF color) { m_stippleColor = color; }
96
97 void setStipplePattern(OdUInt8 pattern) { m_stipplePattern = pattern; }
99
101 void setStipplePattern(OdPs::FillStyle fillStyle, ODCOLORREF color) { setStipplePattern(fillStyle); m_stippleColor = color; }
102};
103
104#include "TD_PackPop.h"
105
106#endif // ODTRVISSECTIONDEF
#define ODCOLORREF
Definition: OdPlatform.h:933
#define ODGETALPHA(rgba)
Definition: OdPlatform.h:940
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
void clear()
Definition: OdArray.h:1400
OdArray & setPhysicalLength(size_type physLength)
Definition: OdArray.h:2223
bool isEmpty() const
Definition: OdArray.h:1547
size_type size() const
Definition: OdArray.h:1247
void push_back(const T &value)
Definition: OdArray.h:1411
const T * getPtr() const
Definition: OdArray.h:1600
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 fillColorInvisible() const
ODCOLORREF stippleColor() const
bool fillColorTransparent() const
bool isStipplingEnabled() const
void setSectionPlanes(const OdTrVisSectionPlaneArray &aPlanes)
void setStipplePattern(OdPs::FillStyle fillStyle)