CFx SDK Documentation  2022 SP0
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_
OdSmartPtr< OdGiDrawable > OdGiDrawablePtr
Definition: GiCommonDraw.h:39
#define GS_TOOLKIT_EXPORT
Definition: GsExport.h:37
#define NULL
Definition: GsProperties.h:177
OdSmartPtr< OdGsProperties > OdGsPropertiesPtr
Definition: GsProperties.h:173
unsigned int OdUInt32
virtual void directRenderOutputImage(const OdGePoint3d *, const OdGiRasterImage *, const OdGsPropertiesDirectRenderOutput::DirectRenderImageParams &)
Definition: GsProperties.h:98
virtual void directRenderOutputTriangleFlat(const OdGePoint3d &, const OdGePoint3d &, const OdGePoint3d &, const OdCmEntityColor &)
Definition: GsProperties.h:82
virtual void directRenderOutputPolygoneFlat(OdUInt32, const OdGePoint3d *, const OdCmEntityColor &)
Definition: GsProperties.h:90
virtual OdUInt32 directRenderOutputFlags() const =0
virtual void directRenderOutputLineFlat(const OdGePoint3d &, const OdGePoint3d &, const OdCmEntityColor &)
Definition: GsProperties.h:74
virtual void directRenderOutputPolygoneGouraud(OdUInt32, const OdGePoint3d *, const OdCmEntityColor *)
Definition: GsProperties.h:94
virtual void directRenderOutputTriangleGouraud(const OdGePoint3d &, const OdGePoint3d &, const OdGePoint3d &, const OdCmEntityColor &, const OdCmEntityColor &, const OdCmEntityColor &)
Definition: GsProperties.h:86
virtual void directRenderOutputLineGouraud(const OdGePoint3d &, const OdGePoint3d &, const OdCmEntityColor &, const OdCmEntityColor &)
Definition: GsProperties.h:78
virtual void directRenderOutputPoint(const OdGePoint3d &, const OdCmEntityColor &)
Definition: GsProperties.h:70
bool hasUnderlyingDrawable() const
void * m_pUnderlyingDrawable
Definition: GsProperties.h:132
virtual void display(OdGsBaseVectorizer &view, OdGsPropertiesDirectRenderOutput *pdro=NULL, OdUInt32 incFlags=kAll)=0
OdGiContext * m_context
Definition: GsProperties.h:134
OdGiDrawablePtr underlyingDrawable() const
const OdGiDrawable * m_pInconsistentDrawable
Definition: GsProperties.h:133
virtual PropertiesType propertiesType() const =0
virtual void update(const OdGiDrawable *pUnderlyingDrawable, OdGsViewImpl *view, OdUInt32 incFlags=kAll)=0
virtual OdSmartPtr< OdGsProperties > propertiesForType(PropertiesType) const
bool isUnderlyingDrawableChanged(const OdGiDrawable *pUnderlyingDrawable) const
ODRX_DECLARE_MEMBERS(OdGsProperties)
void setOpenDrawableFn(OdGiDrawablePtr(*fn)(OdDbStub *))
OdDbStub * underlyingDrawableId() const
void setUnderlyingDrawable(const OdGiDrawable *pUnderlyingDrawable, OdGiContext *ctx)
bool m_bDrawablePersistent
Definition: GsProperties.h:137
OdGiDrawable::DrawableType m_dType
Definition: GsProperties.h:139
OdGiDrawable::DrawableType underlyingDrawableType() const
bool isUnderlyingDrawablePersistent() const