CFx SDK Documentation  2020SP3
GsProperties.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 _ODGSPROPERTIES_H_INCLUDED_
25 #define _ODGSPROPERTIES_H_INCLUDED_
26 
27 #include "OdaCommon.h"
28 #include "RxObject.h"
29 #include "Gi/GiDrawable.h"
30 #include "Gi/GiCommonDraw.h"
31 #include "Gs/GsExport.h"
32 #include "CmColorBase.h"
33 
34 class OdDbStub;
35 
36 class OdGiRasterImage;
37 class OdGsBaseVectorizer;
38 class OdGsViewImpl;
39 
40 #include "TD_PackPush.h"
41 
47 {
48  public:
50  {
58  DirectRender_Image = (1 << 7)
59  };
61  {
62  double u, v;
63  };
65  {
67  const OdGiDrawable *pDrawable; // For images caching
68  };
69  public:
70  virtual void directRenderOutputPoint(const OdGePoint3d &/*point*/,
71  const OdCmEntityColor &/*color*/)
72  {
73  }
74  virtual void directRenderOutputLineFlat(const OdGePoint3d &/*pt1*/, const OdGePoint3d &/*pt2*/,
75  const OdCmEntityColor &/*color*/)
76  {
77  }
78  virtual void directRenderOutputLineGouraud(const OdGePoint3d &/*pt1*/, const OdGePoint3d &/*pt2*/,
79  const OdCmEntityColor &/*clr1*/, const OdCmEntityColor &/*clr2*/)
80  {
81  }
82  virtual void directRenderOutputTriangleFlat(const OdGePoint3d &/*pt1*/, const OdGePoint3d &/*pt2*/, const OdGePoint3d &/*pt3*/,
83  const OdCmEntityColor &/*color*/)
84  {
85  }
86  virtual void directRenderOutputTriangleGouraud(const OdGePoint3d &/*pt1*/, const OdGePoint3d &/*pt2*/, const OdGePoint3d &/*pt3*/,
87  const OdCmEntityColor &/*clr1*/, const OdCmEntityColor &/*clr2*/, const OdCmEntityColor &/*clr3*/)
88  {
89  }
90  virtual void directRenderOutputPolygoneFlat(OdUInt32 /*nPts*/, const OdGePoint3d * /*pPts*/,
91  const OdCmEntityColor &/*color*/)
92  {
93  }
94  virtual void directRenderOutputPolygoneGouraud(OdUInt32 /*nPts*/, const OdGePoint3d * /*pPts*/,
95  const OdCmEntityColor * /*pClrs*/)
96  {
97  }
98  virtual void directRenderOutputImage(const OdGePoint3d * /*pRect*/, const OdGiRasterImage * /*pImage*/,
100  {
101  }
102 
103  virtual OdUInt32 directRenderOutputFlags() const = 0;
104 };
105 
111 {
112 public:
114  {
115  kViewport = 1,
116  kBackground = (1 << 1),
117  kVisualStyle = (1 << 2),
118  kRenderEnvironment = (1 << 3),
119  kRenderSettings = (1 << 4),
120  // Simple device
121  kDeviceSimple = 0,
122  // Background-compatible device
123  kDeviceBackground = 3, // kViewport | kBackground
124  // Normal vectorization device
125  kDeviceNormal = 7, // kViewport | kBackground | kVisualStyle
126  // Rendering device
127  kDeviceRender = 0xFF, // kAll
128  // Enable all properties
129  kAll = 0xFF
130  };
131 protected:
135 
136  OdGiDrawablePtr (*m_pOpenDrawableFn)(OdDbStub* id);
138  // For optimize
140 public:
142 
144 
145  void setOpenDrawableFn(OdGiDrawablePtr (*fn)(OdDbStub*));
146 
147  void setUnderlyingDrawable(const OdGiDrawable *pUnderlyingDrawable, OdGiContext* ctx);
149  bool isUnderlyingDrawableChanged(const OdGiDrawable *pUnderlyingDrawable) const;
150  bool hasUnderlyingDrawable() const;
151 
153  OdDbStub* underlyingDrawableId() const;
154 
156 
157  virtual PropertiesType propertiesType() const = 0;
158 
159  // Search down in hierarchy for appropriate properties
161 
162  // Update attributes
163  virtual void update(const OdGiDrawable* pUnderlyingDrawable,
164  OdGsViewImpl* view, OdUInt32 incFlags = kAll) = 0;
165  // Display attributed data
166  virtual void display(OdGsBaseVectorizer& view,
167  OdGsPropertiesDirectRenderOutput *pdro = NULL, OdUInt32 incFlags = kAll) = 0;
168 };
169 
174 
175 // NULL
176 #ifndef NULL
177 #define NULL 0
178 #endif
179 
180 #include "TD_PackPop.h"
181 
182 #endif // _ODGSPROPERTIES_H_INCLUDED_
OdCmEntityColor
Definition: CmColorBase.h:68
OdGiContext
Definition: GiCommonDraw.h:108
NULL
#define NULL
Definition: GsProperties.h:177
OdGsPropertiesDirectRenderOutput::directRenderOutputPolygoneGouraud
virtual void directRenderOutputPolygoneGouraud(OdUInt32, const OdGePoint3d *, const OdCmEntityColor *)
Definition: GsProperties.h:94
OdGsPropertiesDirectRenderOutput::DirectRender_PolygoneFlat
@ DirectRender_PolygoneFlat
Definition: GsProperties.h:56
OdGsPropertiesDirectRenderOutput::DirectRenderImageUV
Definition: GsProperties.h:61
OdGsBaseVectorizer
Definition: GsBaseVectorizer.h:112
OdGsPropertiesDirectRenderOutput::directRenderOutputImage
virtual void directRenderOutputImage(const OdGePoint3d *, const OdGiRasterImage *, const OdGsPropertiesDirectRenderOutput::DirectRenderImageParams &)
Definition: GsProperties.h:98
OdGsProperties::underlyingDrawableType
OdGiDrawable::DrawableType underlyingDrawableType() const
OdGsProperties::isUnderlyingDrawableChanged
bool isUnderlyingDrawableChanged(const OdGiDrawable *pUnderlyingDrawable) const
OdGsProperties::propertiesForType
virtual OdSmartPtr< OdGsProperties > propertiesForType(PropertiesType) const
OdRxObject
Definition: RxObject.h:564
OdGsPropertiesDirectRenderOutput::DirectRender_TriangleFlat
@ DirectRender_TriangleFlat
Definition: GsProperties.h:54
OdGsProperties::propertiesType
virtual PropertiesType propertiesType() const =0
OdGsProperties::hasUnderlyingDrawable
bool hasUnderlyingDrawable() const
OdGsPropertiesDirectRenderOutput::directRenderOutputPoint
virtual void directRenderOutputPoint(const OdGePoint3d &, const OdCmEntityColor &)
Definition: GsProperties.h:70
OdGsPropertiesDirectRenderOutput::directRenderOutputLineGouraud
virtual void directRenderOutputLineGouraud(const OdGePoint3d &, const OdGePoint3d &, const OdCmEntityColor &, const OdCmEntityColor &)
Definition: GsProperties.h:78
OdGsProperties::m_pUnderlyingDrawable
void * m_pUnderlyingDrawable
Definition: GsProperties.h:132
TD_PackPop.h
OdGsPropertiesDirectRenderOutput::DirectRender_PolygoneGouraud
@ DirectRender_PolygoneGouraud
Definition: GsProperties.h:57
OdGsProperties::display
virtual void display(OdGsBaseVectorizer &view, OdGsPropertiesDirectRenderOutput *pdro=NULL, OdUInt32 incFlags=kAll)=0
OdGsProperties::underlyingDrawable
OdGiDrawablePtr underlyingDrawable() const
OdGsProperties::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdGsProperties)
RxObject.h
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGsPropertiesPtr
OdSmartPtr< OdGsProperties > OdGsPropertiesPtr
Definition: GsProperties.h:173
OdGsProperties::OdGsProperties
OdGsProperties()
OdGsProperties::isUnderlyingDrawablePersistent
bool isUnderlyingDrawablePersistent() const
OdGsPropertiesDirectRenderOutput::directRenderOutputLineFlat
virtual void directRenderOutputLineFlat(const OdGePoint3d &, const OdGePoint3d &, const OdCmEntityColor &)
Definition: GsProperties.h:74
OdGsPropertiesDirectRenderOutput::DirectRender_Point
@ DirectRender_Point
Definition: GsProperties.h:51
OdGsPropertiesDirectRenderOutput::DirectRenderImageParams
Definition: GsProperties.h:65
OdSmartPtr
Definition: SmartPtr.h:58
OdGePoint3d
Definition: GePoint3d.h:55
OdGsProperties
Definition: GsProperties.h:111
OdGsProperties::m_dType
OdGiDrawable::DrawableType m_dType
Definition: GsProperties.h:139
OdGiDrawable
Definition: GiDrawable.h:49
OdGsViewImpl
Definition: GsViewImpl.h:58
OdGsPropertiesDirectRenderOutput::DirectRenderImageUV::v
double v
Definition: GsProperties.h:62
OdaCommon.h
GiCommonDraw.h
OdGiDrawablePtr
OdSmartPtr< OdGiDrawable > OdGiDrawablePtr
Definition: GiCommonDraw.h:39
OdGsProperties::setUnderlyingDrawable
void setUnderlyingDrawable(const OdGiDrawable *pUnderlyingDrawable, OdGiContext *ctx)
OdGsPropertiesDirectRenderOutput::DirectRenderImageParams::pDrawable
const OdGiDrawable * pDrawable
Definition: GsProperties.h:67
CmColorBase.h
TD_PackPush.h
GsExport.h
OdGsProperties::m_context
OdGiContext * m_context
Definition: GsProperties.h:134
OdGsPropertiesDirectRenderOutput::DirectRenderImageUV::u
double u
Definition: GsProperties.h:62
OdGsProperties::underlyingDrawableId
OdDbStub * underlyingDrawableId() const
OdGsPropertiesDirectRenderOutput::directRenderOutputTriangleFlat
virtual void directRenderOutputTriangleFlat(const OdGePoint3d &, const OdGePoint3d &, const OdGePoint3d &, const OdCmEntityColor &)
Definition: GsProperties.h:82
OdGsProperties::m_pInconsistentDrawable
const OdGiDrawable * m_pInconsistentDrawable
Definition: GsProperties.h:133
OdGsPropertiesDirectRenderOutput::DirectRenderFlags
DirectRenderFlags
Definition: GsProperties.h:50
OdGsPropertiesDirectRenderOutput::directRenderOutputPolygoneFlat
virtual void directRenderOutputPolygoneFlat(OdUInt32, const OdGePoint3d *, const OdCmEntityColor &)
Definition: GsProperties.h:90
OdGiDrawable::DrawableType
DrawableType
Definition: GiDrawable.h:86
OdGsPropertiesDirectRenderOutput::DirectRender_Image
@ DirectRender_Image
Definition: GsProperties.h:58
OdGsPropertiesDirectRenderOutput
Definition: GsProperties.h:47
GS_TOOLKIT_EXPORT
#define GS_TOOLKIT_EXPORT
Definition: GsExport.h:37
GiDrawable.h
OdGsPropertiesDirectRenderOutput::DirectRender_TriangleGouraud
@ DirectRender_TriangleGouraud
Definition: GsProperties.h:55
OdGsPropertiesDirectRenderOutput::DirectRender_LineGouraud
@ DirectRender_LineGouraud
Definition: GsProperties.h:53
OdGsProperties::PropertiesType
PropertiesType
Definition: GsProperties.h:114
OdGsPropertiesDirectRenderOutput::DirectRender_LineFlat
@ DirectRender_LineFlat
Definition: GsProperties.h:52
OdGsPropertiesDirectRenderOutput::directRenderOutputTriangleGouraud
virtual void directRenderOutputTriangleGouraud(const OdGePoint3d &, const OdGePoint3d &, const OdGePoint3d &, const OdCmEntityColor &, const OdCmEntityColor &, const OdCmEntityColor &)
Definition: GsProperties.h:86
OdGsProperties::setOpenDrawableFn
void setOpenDrawableFn(OdGiDrawablePtr(*fn)(OdDbStub *))
OdGsPropertiesDirectRenderOutput::DirectRenderImageParams::uvCoords
DirectRenderImageUV * uvCoords
Definition: GsProperties.h:66
OdGiRasterImage
Definition: GiRasterImage.h:37
OdGsProperties::m_bDrawablePersistent
bool m_bDrawablePersistent
Definition: GsProperties.h:137
OdGsProperties::update
virtual void update(const OdGiDrawable *pUnderlyingDrawable, OdGsViewImpl *view, OdUInt32 incFlags=kAll)=0
OdGsPropertiesDirectRenderOutput::directRenderOutputFlags
virtual OdUInt32 directRenderOutputFlags() const =0