CFx SDK Documentation  2022 SP0
GsBaseInclude.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 ODGSBASEINCLUDE_INC
25 #define ODGSBASEINCLUDE_INC
26 
27 // Previously GsBaseVectorizer.h defines module/device/view classes
28 #include "Gs/GsBaseModule.h"
30 #include "Gs/GsBaseVectorizer.h"
31 #include "Gs/GsBaseVectorizeView.h"
32 #include "SaveState.h"
33 #include "RxDictionary.h"
34 #include "RxObjectImpl.h"
35 #include "RxVariantValue.h"
36 #include "ThreadsCounter.h"
37 
38 #include "TD_PackPush.h"
39 
40 //FELIX_CHANGE
41 #undef check
42 
50 template <class BaseVectorizerObject>
51 class OdGsBaseVectorizeViewJoin : public OdGsBaseVectorizeView, public BaseVectorizerObject
52 {
53  public:
55  {
57  }
58 
60 
62 
63 #if !defined(_MSC_VER) || (_MSC_VER < 1600)
64  ODRX_USING_HEAP_OPERATORS(BaseVectorizerObject);
65 #else
66  // Usage of template class as a base for new/delete operators in 'using' directive causes IntelliSense crash in VS2010
68 #endif
69 
70 #if 0
71 
72  // Resolve ambiguous access
73  bool isPerspective() const
74  {
76  //return OdGsBaseVectorizer::view().isPerspective();
77  }
79  {
81  }
82  void getNumPixelsInUnitSquare(const OdGePoint3d& givenWorldpt,
83  OdGePoint2d& pixelArea, bool includePerspective = true) const
84  {
85  OdGsViewImpl::getNumPixelsInUnitSquare(givenWorldpt, pixelArea, includePerspective);
86  //OdGsBaseVectorizer::view().getNumPixelsInUnitSquare(givenWorldpt, pixelArea, includePerspective);
87  }
88 
89 #else
90  // Resolve ambiguous access. Typically we wants to call it from vectorizer, elsewhere it is not differs from worldToDevice.
92  {
94  }
95  int lineweightToPixels(OdDb::LineWeight lineweight) const
96  {
98  }
99  double lineweightToPixels(double lineweight) const
100  {
102  }
104  {
106  }
107  bool isSupportPlotStyles() const
108  {
110  }
111 #endif
112  protected:
114 };
115 
123 template <class BaseVectorizerObject>
124 
125 class OdGsBaseVectorizeViewJoinMT : public OdGsBaseVectorizeViewJoin<BaseVectorizerObject>
126 {
127  protected:
130  public:
132  : m_vectUsage(0)
133  {
134  }
135 
136  virtual OdUInt32 numVectorizers() const
137  {
138  if (OdGsBaseVectorizeView::baseDevice()->m_vectPerfData.enableParallelVectorization())
139  {
141  if (pDevice && !pDevice->properties().isNull() &&
142  pDevice->properties()->has(OD_T("MaxRegenThreads")))
143  return (OdUInt32)OdRxVariantValue(pDevice->properties()->getAt(OD_T("MaxRegenThreads")))->getUInt16();
144  return 4;
145  }
146  return 1;
147  }
148  virtual OdGsBaseVectorizer* getVectorizer(bool /*bDisplay*/)
149  {
150  m_vectUsage++;
151  if (m_vectUsage == 1)
152  return this;
153  if (m_vectorizers.size() < m_vectUsage - 1)
154  {
155  OdGsViewPtr pView;
156  {
159  pView = OdGsBaseVectorizeView::cloneView(false);
160  }
161  OdGsBaseVectorizeViewJoinMT *pThis = static_cast<OdGsBaseVectorizeViewJoinMT*>(pView.get());
162  pThis->setUp(OdGsBaseVectorizer::view());
163  m_vectorizers.push_back(pView);
164  }
165  OdGsBaseVectorizer *pVect = static_cast<OdGsBaseVectorizeViewJoinMT*>(m_vectorizers[m_vectUsage - 2].get());
166  // viewParams?
167  return pVect;
168  }
169  virtual void releaseVectorizer(OdGsBaseVectorizer* /*pVect*/)
170  {
171  m_vectUsage--;
172  }
173 
174  bool isMTRegen() const
175  {
176  return odThreadsCounter();
177  }
178  //bool isMTView() const
179  //{
180  // return (&view() != this);
181  //}
182 
183  // Note: do not delete this code branch, it is useful for find places where view is called unsafe for MT.
184 #if 0
185  private:
186 
187 #define MT_VECT_VIEWMTH(mthSem, mthCall) \
188  mthSem \
189  { \
190  if (&view() != this) \
191  view().mthCall; \
192  OdGsViewImpl::mthCall; \
193  }
194 #define MT_VECT_VIEWMTH_RET(mthSem, mthCall) \
195  mthSem \
196  { \
197  if (&view() != this) \
198  return view().mthCall; \
199  return OdGsViewImpl::mthCall; \
200  }
201 
202  MT_VECT_VIEWMTH_RET(RenderMode mode() const, mode())
203  //MT_VECT_VIEWMTH(void setMode(RenderMode mode), setMode(mode))
204  //MT_VECT_VIEWMTH(void freezeLayer(OdDbStub* layerID), freezeLayer(layerID))
205  //MT_VECT_VIEWMTH(void thawLayer(OdDbStub* layerID), thawLayer(layerID))
206  //MT_VECT_VIEWMTH(void clearFrozenLayers(), clearFrozenLayers());
207  //MT_VECT_VIEWMTH(void setViewportBorderProperties(ODCOLORREF color, int width), setViewportBorderProperties(color, width))
208  MT_VECT_VIEWMTH(void getViewportBorderProperties(ODCOLORREF& color, int& width) const, getViewportBorderProperties(color, width))
209  //MT_VECT_VIEWMTH(void setViewportBorderVisibility(bool visible), setViewportBorderVisibility(visible))
210  MT_VECT_VIEWMTH_RET(bool isViewportBorderVisible() const, isViewportBorderVisible())
211  //MT_VECT_VIEWMTH(void setEnableFrontClip(bool enable), setEnableFrontClip(enable))
212  MT_VECT_VIEWMTH_RET(bool isFrontClipped() const, isFrontClipped())
213  //MT_VECT_VIEWMTH(void setFrontClip(double distance), setFrontClip(distance))
214  MT_VECT_VIEWMTH_RET(double frontClip() const, frontClip())
215  //MT_VECT_VIEWMTH(void setEnableBackClip(bool enable), setEnableBackClip(enable))
216  MT_VECT_VIEWMTH_RET(bool isBackClipped() const, isBackClipped())
217  //MT_VECT_VIEWMTH(void setBackClip(double distance), setBackClip(distance))
218  MT_VECT_VIEWMTH_RET(double backClip() const, backClip())
219  MT_VECT_VIEWMTH_RET(OdGePoint3d position() const, position())
220  MT_VECT_VIEWMTH_RET(OdGePoint3d target() const, target())
221  MT_VECT_VIEWMTH_RET(OdGeVector3d upVector() const, upVector())
222  MT_VECT_VIEWMTH_RET(double fieldWidth() const, fieldWidth())
223  MT_VECT_VIEWMTH_RET(double fieldHeight() const, fieldHeight())
224  MT_VECT_VIEWMTH_RET(double windowAspect() const, windowAspect())
225  MT_VECT_VIEWMTH_RET(double lensLength() const, lensLength())
226  //MT_VECT_VIEWMTH(void setLensLength(double lensLength), setLensLength(lensLength))
227  MT_VECT_VIEWMTH_RET(bool isPerspective() const, isPerspective())
228  //MT_VECT_VIEWMTH(void beginInteractivity(double frameRateInHz), beginInteractivity(frameRateInHz))
229  //MT_VECT_VIEWMTH(void endInteractivity(), endInteractivity())
230  //MT_VECT_VIEWMTH(void flush(), flush())
231  //MT_VECT_VIEWMTH(void hide(), hide())
232  //MT_VECT_VIEWMTH(void show(), show())
233  MT_VECT_VIEWMTH_RET(bool isVisible(), isVisible())
234  //MT_VECT_VIEWMTH_RET(OdGsViewPtr cloneView(bool cloneViewParameters = true, bool cloneGeometry = false),
235  // cloneView(cloneViewParameters, cloneGeometry))
236  //MT_VECT_VIEWMTH_RET(bool exceededBounds(), exceededBounds())
237  //MT_VECT_VIEWMTH(void enableStereo(bool enabled), enableStereo(enabled))
238  MT_VECT_VIEWMTH_RET(bool isStereoEnabled() const, isStereoEnabled())
239  //MT_VECT_VIEWMTH(void setStereoParameters(double magnitude, double parallax), setStereoParameters(magnitude, parallax))
240  MT_VECT_VIEWMTH(void getStereoParameters(double& magnitude, double& parallax) const, getStereoParameters(magnitude, parallax))
241  //MT_VECT_VIEWMTH(void initLights(OdRxIterator* pLightsIterator), initLights(pLightsIterator))
242  //MT_VECT_VIEWMTH(void setViewport(const OdGePoint2d& lowerLeft, const OdGePoint2d& upperRight), setViewport(lowerLeft, upperRight))
243  //MT_VECT_VIEWMTH(void setViewport(const OdGsDCRect& screenRect), setViewport(screenRect))
244  //MT_VECT_VIEWMTH(void setViewport(const OdGsDCRectDouble& screenRec), setViewport(screenRec))
245  MT_VECT_VIEWMTH(void getViewport(OdGePoint2d& lowerLeft, OdGePoint2d& upperRight) const, getViewport(lowerLeft, upperRight))
246  MT_VECT_VIEWMTH(void getViewport(OdGsDCRect& screenRect) const, getViewport(screenRect))
247  MT_VECT_VIEWMTH(void getViewport(OdGsDCRectDouble& screenRec) const, getViewport(screenRec))
248  MT_VECT_VIEWMTH_RET(OdGeMatrix3d screenMatrix() const, screenMatrix())
249  MT_VECT_VIEWMTH_RET(OdGeMatrix3d worldToDeviceMatrix() const, worldToDeviceMatrix())
251  MT_VECT_VIEWMTH_RET(OdGeMatrix3d viewingMatrix() const, viewingMatrix())
252  MT_VECT_VIEWMTH_RET(OdGeMatrix3d projectionMatrix() const, projectionMatrix())
253  //MT_VECT_VIEWMTH(void viewParameters(OdGsView* pView) const, viewParameters(pView))
254  MT_VECT_VIEWMTH_RET(double lineweightToDcScale() const, lineweightToDcScale())
255  //MT_VECT_VIEWMTH(void setLineweightToDcScale(double scale), setLineweightToDcScale(scale))
256  //MT_VECT_VIEWMTH(void setLineweightEnum(int numLineweights, const OdUInt8* lineweights), setLineweightEnum(numLineweights, lineweights))
257  //MT_VECT_VIEWMTH(void setLinetypeScaleMultiplier(double linetypeScaleMultiplier), setLinetypeScaleMultiplier(linetypeScaleMultiplier))
258  //MT_VECT_VIEWMTH(void setAlternateLinetypeScaleMultiplier(double linetypeAlternateScaleMultiplier),
259  // setAlternateLinetypeScaleMultiplier(linetypeAlternateScaleMultiplier))
260  MT_VECT_VIEWMTH_RET(double linetypeScaleMultiplier() const, linetypeScaleMultiplier())
261  //MT_VECT_VIEWMTH(void dolly(const OdGeVector3d& dollyVector), dolly(dollyVector))
262  //MT_VECT_VIEWMTH(void dolly(double xDolly, double yDolly, double zDolly), dolly(xDolly, yDolly, zDolly))
263  //MT_VECT_VIEWMTH(void roll(double rollAngle), roll(rollAngle))
264  //MT_VECT_VIEWMTH(void orbit(double xOrbit, double yOrbit), orbit(xOrbit, yOrbit))
265  //MT_VECT_VIEWMTH(void zoom(double zoomFactor), zoom(zoomFactor))
266  //MT_VECT_VIEWMTH(void pan(double xPan, double yPan), pan(xPan, yPan))
267  //MT_VECT_VIEWMTH(void setView(const OdGePoint3d & position, const OdGePoint3d& target, const OdGeVector3d& upVector,
268  // double fieldWidth, double fieldHeight, Projection projection = kParallel),
269  // setView(position, target, upVector, fieldWidth, fieldHeight, projection))
270  MT_VECT_VIEWMTH(void viewportClipRegion(OdIntArray& counts, OdGePoint2dArray& vertices) const,
271  viewportClipRegion(counts, vertices))
272  MT_VECT_VIEWMTH(void viewportClipRegion(OdIntArray& counts, OdGsDCPointArray& dcPts) const,
273  viewportClipRegion(counts, dcPts))
274  //MT_VECT_VIEWMTH(void setViewportClipRegion(int numContours, const int* numVertices, const OdGePoint2d* vertices),
275  // setViewportClipRegion(numContours, numVertices, vertices))
276  //MT_VECT_VIEWMTH(void setViewportClipRegion(int numContours, int const* numVertices, OdGsDCPoint const* vertices),
277  // setViewportClipRegion(numContours, numVertices, vertices))
278  MT_VECT_VIEWMTH_RET(bool isDependentViewportView() const, isDependentViewportView())
279  MT_VECT_VIEWMTH_RET(bool isDependentGeometryView() const, isDependentGeometryView())
280  MT_VECT_VIEWMTH_RET(bool isHelperView() const, isHelperView())
282  MT_VECT_VIEWMTH_RET(const OdGiContextualColors *contextualColors() const, contextualColors())
283  //MT_VECT_VIEWMTH(void setContextualColors(OdGiContextualColors *pColors), setContextualColors())
284  MT_VECT_VIEWMTH_RET(bool pointInViewport(const OdGePoint2d& screenPoint) const, pointInViewport(screenPoint))
285  //MT_VECT_VIEWMTH(void setClearColor(ClearColor color), setClearColor(color))
286  MT_VECT_VIEWMTH(void invalidate(), invalidate())
287  MT_VECT_VIEWMTH(void invalidate(const OdGsDCRect &rect), invalidate(rect))
289  //MT_VECT_VIEWMTH(void select(const OdGsDCPoint* points, int numPoints, OdGsSelectionReactor* pReactor, OdGsView::SelectionMode mode = OdGsView::kCrossing),
290  // select(points, numPoints, pReactor, mode))
291  //MT_VECT_VIEWMTH_RET(bool add(OdGiDrawable* sceneGraph, OdGsModel* model), add(sceneGraph, model))
292  //MT_VECT_VIEWMTH_RET(bool erase(OdGiDrawable* sceneGraph), erase(sceneGraph))
293  //MT_VECT_VIEWMTH(void eraseAll(), eraseAll())
294  MT_VECT_VIEWMTH_RET(bool isValid() const, isValid())
295  MT_VECT_VIEWMTH(void getNumPixelsInUnitSquare(const OdGePoint3d& givenWorldpt, OdGePoint2d& pixelArea, bool includePerspective = true) const,
296  getNumPixelsInUnitSquare(givenWorldpt, pixelArea, includePerspective));
297  //MT_VECT_VIEWMTH(void setBackground(OdDbStub *backgroundId), setBackground(backgroundId))
298  MT_VECT_VIEWMTH_RET(OdDbStub *background() const, background())
299  //MT_VECT_VIEWMTH(void setVisualStyle(OdDbStub *visualStyleId), setVisualStyle(visualStyleId))
300  MT_VECT_VIEWMTH_RET(OdDbStub *visualStyle() const, visualStyle())
301  //MT_VECT_VIEWMTH(void setVisualStyle(const OdGiVisualStyle &visualStyle), setVisualStyle(visualStyle))
302  MT_VECT_VIEWMTH_RET(bool visualStyle(OdGiVisualStyle &visualStyle) const, visualStyle(visualStyle))
303  MT_VECT_VIEWMTH_RET(OdUInt32 viewportId() const, viewportId())
304  MT_VECT_VIEWMTH_RET(OdDbStub* getViewportObjectId() const, getViewportObjectId())
305  //MT_VECT_VIEWMTH_RET(bool viewExtents(OdGeBoundBlock3d& extents) const, viewExtents(extents))
306  //MT_VECT_VIEWMTH(void select(const OdGePoint2d* aPtDc, int numPoints, OdGsSelectionReactor* pReactor, OdGsView::SelectionMode mode = OdGsView::kCrossing),
307  // select(aPtDc, numPoints, pReactor, mode))
308  MT_VECT_VIEWMTH_RET(bool isSnapping() const, isSnapping())
309  //MT_VECT_VIEWMTH(void setSnapping(bool val), setSnapping(val))
310  MT_VECT_VIEWMTH_RET(bool isRegenOnDrawForbidden() const, isRegenOnDrawForbidden())
311  //MT_VECT_VIEWMTH(void setRegenOnDrawForbidden(bool val), setRegenOnDrawForbidden())
312  //MT_VECT_VIEWMTH(void clearLinetypeCache(), clearLinetypeCache())
313  MT_VECT_VIEWMTH_RET(double linetypeAlternateScaleMultiplier() const, linetypeAlternateScaleMultiplier())
314  MT_VECT_VIEWMTH_RET(OdUInt32 frozenLayers() const, frozenLayers())
315  MT_VECT_VIEWMTH(void frozenLayers(OdDbStubPtrArray& frozenLayers) const, frozenLayers(frozenLayers))
316  MT_VECT_VIEWMTH_RET(bool isLayerVisible(OdDbStub* layerId) const, isLayerVisible(layerId))
317  MT_VECT_VIEWMTH_RET(int lineweightToPixels(OdDb::LineWeight lineweight) const, lineweightToPixels(lineweight))
318  MT_VECT_VIEWMTH_RET(double lineweightToPixels(double lineweight) const, lineweightToPixels(lineweight))
319  MT_VECT_VIEWMTH(void screenRect(OdGsDCPoint &lowerLeft, OdGsDCPoint &upperRight) const, screenRect(lowerLeft, upperRight))
320  MT_VECT_VIEWMTH(void screenRect(OdGePoint2d &lowerLeft, OdGePoint2d &upperRight) const, screenRect(lowerLeft, upperRight))
321  MT_VECT_VIEWMTH(void screenRectNorm(OdGsDCRect& normalizedRect) const, screenRectNorm(normalizedRect))
322  MT_VECT_VIEWMTH(void viewportDcCorners(OdGePoint2d& lower_left, OdGePoint2d& upper_right) const, viewportDcCorners(lower_left, upper_right))
323  MT_VECT_VIEWMTH_RET(bool doPerspectivePt(OdGePoint3d& point) const, doPerspectivePt(point))
324  MT_VECT_VIEWMTH_RET(bool doInversePerspectivePt(OdGePoint3d& point) const, doInversePerspectivePt(point))
325  MT_VECT_VIEWMTH_RET(OdGeMatrix3d eyeToScreenMatrix() const, eyeToScreenMatrix())
326  MT_VECT_VIEWMTH_RET(const OdGeMatrix3d& eyeToWorldMatrix() const, eyeToWorldMatrix())
327  MT_VECT_VIEWMTH_RET(const OdGeMatrix3d& worldToEyeMatrix() const, worldToEyeMatrix())
328  MT_VECT_VIEWMTH_RET(ClearColor clearColor() const, clearColor())
329  MT_VECT_VIEWMTH(void invalidate(const OdGeExtents3d& worldExt, OdDb::LineWeight extendByLineweight = OdDb::kLnWt000),
330  invalidate(worldExt, extendByLineweight))
331  MT_VECT_VIEWMTH(void invalidateRegion(const OdGiPathNode& path), invalidateRegion(path))
332  MT_VECT_VIEWMTH_RET(OdGsDCRectArray invalidRects() const, invalidRects())
333  MT_VECT_VIEWMTH_RET(bool isViewportOnScreen() const, isViewportOnScreen())
334  MT_VECT_VIEWMTH_RET(bool isCompletelyVisible() const, isCompletelyVisible())
335  //MT_VECT_VIEWMTH(void setInversion(bool invertedX, bool invertedY), setInversion(invertexX, invertexY))
336  MT_VECT_VIEWMTH_RET(OdGiRegenType getRegenType() const, getRegenType())
337  MT_VECT_VIEWMTH_RET(double focalLength() const, focalLength())
338  MT_VECT_VIEWMTH_RET(const OdGeVector3d& eyeVector() const, eyeVector())
339  MT_VECT_VIEWMTH_RET(const OdGeVector3d& xVector() const, xVector())
340  MT_VECT_VIEWMTH_RET(double getLinetypeScaleMultiplier() const, getLinetypeScaleMultiplier())
341  MT_VECT_VIEWMTH_RET(double getLinetypeGenerationCriteria() const, getLinetypeGenerationCriteria())
342  MT_VECT_VIEWMTH_RET(double getDeviation(const OdGiDeviationType deviationType, const OdGePoint3d& pointOnCurve, bool bRecalculate = false) const,
343  getDeviation(deviationType, pointOnCurve, bRecalculate))
344  //MT_VECT_VIEWMTH(void initDeviation(), initDeviation())
345  MT_VECT_VIEWMTH_RET(int cachedDrawables() const, cachedDrawables())
346 #ifdef ODGS_LOCAL_IDS
347  MT_VECT_VIEWMTH_RET(OdUInt32 localViewportId(const OdGsBaseModel *pModel) const, localViewportId(pModel))
348  MT_VECT_VIEWMTH_RET(OdGsViewLocalId &getViewLocalId(), getViewLocalId())
349 #endif
350  //MT_VECT_VIEWMTH_RET(bool sceneDept(double& zNear, double& zFar, OdGsOverlayId nOverlay = kGsMainOverlay) const, sceneDept(zNear, zFar, nOverlay))
351  //MT_VECT_VIEWMTH_RET(bool usesDept(double* pMinDeptSupported = 0, double* pMaxDeptSupported = 0) const, usesDept(pMinDeptSupported, pMaxDepSupported))
352  MT_VECT_VIEWMTH_RET(bool isNonRectClipped() const, isNonRectClipped())
353  MT_VECT_VIEWMTH_RET(bool hasLweights() const, hasLweights())
354  MT_VECT_VIEWMTH_RET(const OdGePoint2d& dcScreenMin() const, dcScreenMin())
355  MT_VECT_VIEWMTH_RET(const OdGePoint2d& dcScreenMax() const, dcScreenMax())
356  MT_VECT_VIEWMTH_RET(const OdGePoint2d& dcLowerLeft() const, dcLowerLeft())
357  MT_VECT_VIEWMTH_RET(const OdGePoint2d& dcUpperRight() const, dcUpperRight())
358  MT_VECT_VIEWMTH_RET(OdGeMatrix3d perspectiveMatrix() const, perspectiveMatrix())
359  //MT_VECT_VIEWMTH(void invalidateCachedViewportGeometry(OdUInt32 mask), invalidateCachedViewportGeometry(mask))
360  MT_VECT_VIEWMTH_RET(double calcDeviation(const OdGiDeviationType type, const OdGePoint3d& pt) const, calcDeviation(type, pt))
362  MT_VECT_VIEWMTH_RET(bool updateViewportProperties(OdUInt32 incFlags), updateViewportProperties(incFlags))
364  MT_VECT_VIEWMTH_RET(const OdGeMatrix3d& rotationMatrix() const, rotationMatrix())
365  MT_VECT_VIEWMTH_RET(short viewportRotation() const, viewportRotation())
366  MT_VECT_VIEWMTH_RET(bool isRotated() const, isRotated())
367  MT_VECT_VIEWMTH_RET(double unrotatedFieldHeight() const, unrotatedFieldHeight())
368  MT_VECT_VIEWMTH_RET(double unrotatedFieldWidth() const, unrotatedFieldWidth())
369  //MT_VECT_VIEWMTH(void initCullingVolume(), initCullingVolume())
370  //MT_VECT_VIEWMTH(void setCullingVolume(OdGsCullingVolumePtr newVol), setCullingVolume(newVol))
371  MT_VECT_VIEWMTH_RET(OdGsCullingVolumePtr cullingVolume() const, cullingVolume())
372  MT_VECT_VIEWMTH_RET(bool isCullingVolumeInitialized() const, isCullingVolumeInitialized())
373  MT_VECT_VIEWMTH_RET(bool cullingVolumeIntersectWithOpt(const OdGsCullingPrimitive &prim) const, cullingVolumeIntersectWithOpt(prim))
374  MT_VECT_VIEWMTH_RET(OdGsCullingVolume::IntersectionStatus cullingVolumeIntersectWith(const OdGsCullingPrimitive &prim) const,
376  MT_VECT_VIEWMTH(void cullingVolumeTransformBy(const OdGeMatrix3d &xfm), cullingVolumeTransformBy(xfm))
377 
378 #undef MT_VECT_VIEWMTH_RET
379 #undef MT_VECT_VIEWMTH
380 
381 #endif
382 };
383 
391 class OdGsBaseVectorizeViewDef : public OdGsBaseVectorizeViewJoin<OdGsBaseVectorizer>
392 {
393  public:
395 };
396 
404 class OdGsBaseVectorizeViewMT : public OdGsBaseVectorizeViewJoinMT<OdGsBaseVectorizer>
405 {
406  public:
408 
409  bool isMTView() const
410  {
411  return (&view() != this);
412  }
413 };
414 
422 template <int SyncCount = 4>
424 {
425  protected:
426  OdMutexPtr m_locker[SyncCount];
428  public:
430  void setEnabled(bool bEnable) { m_bEnabled = bEnable; }
431  bool isEnabled() const { return m_bEnabled; }
432  void lock(OdUInt32 nSync)
433  {
434  //if (odThreadsCounter())
435  if (m_bEnabled)
436  m_locker[nSync].get()->lock();
437  }
438  void unlock(OdUInt32 nSync)
439  {
440  //if (odThreadsCounter())
441  if (m_bEnabled)
442  m_locker[nSync].get()->unlock();
443  }
444  protected:
445  void check(int nSyncObjects) { if (nSyncObjects != SyncCount) throw OdError(eOutOfRange); }
446  public:
448  {
449  OdGsBaseDeviceMTHelpersTemplate &m_syncPoint;
450  OdUInt32 m_syncType;
451  public:
453  : m_syncPoint(syncPoint), m_syncType(syncType)
454  {
455  m_syncPoint.lock(m_syncType);
456  }
458  {
459  m_syncPoint.unlock(m_syncType);
460  }
461  };
462 };
463 
472 {
473  public:
474  enum SyncType
475  {
480 
481  kSyncCount
482  };
483  public:
487 };
488 
497 {
498  public:
500  : OdGsBaseDeviceMTHelpers::SyncHelper(syncPoint, syncType) {}
501 };
502 
503 #include "TD_PackPop.h"
504 
505 #endif // ODGSBASEINCLUDE_INC
true
Definition: DimVarDefs.h:2046
false
Definition: DimVarDefs.h:165
OdGiRegenType
Definition: GiCommonDraw.h:50
OdGiDeviationType
Definition: GiCommonDraw.h:64
#define IMPL_VECTORIZER_DEFAULT()
#define ODCOLORREF
Definition: OdPlatform.h:883
#define OD_T(x)
unsigned int OdUInt32
#define OdSaveStateFlag(type, flag, name, flags, newVal)
Definition: SaveState.h:82
FIRSTDLL_EXPORT ThreadsCounter & odThreadsCounter()
bool isNull() const
Definition: BaseObjectPtr.h:70
int lineweightToPixels(OdDb::LineWeight lineweight) const
OdGsViewImpl & view() const
virtual OdGeMatrix3d objectToDeviceMatrix() const
void unlock(SyncType nSync)
void lock(SyncType nSync)
SyncHelper(OdGsBaseDeviceMTHelpersTemplate &syncPoint, OdUInt32 syncType)
void unlock(OdUInt32 nSync)
void check(int nSyncObjects)
OdMutexPtr m_locker[SyncCount]
OdGsBaseDeviceMTSyncHelper(OdGsBaseDeviceMTHelpers &syncPoint, OdGsBaseDeviceMTHelpers::SyncType syncType)
void setVisualStyle(const OdGiVisualStyle &visualStyle)
int lineweightToPixels(OdDb::LineWeight lineweight) const
Definition: GsBaseInclude.h:95
OdGeMatrix3d objectToDeviceMatrix() const
Definition: GsBaseInclude.h:91
bool isSupportPlotStyles() const
ODRX_USING_HEAP_OPERATORS(BaseVectorizerObject)
virtual void clearLinetypeCache()
Definition: GsBaseInclude.h:61
double lineweightToPixels(double lineweight) const
Definition: GsBaseInclude.h:99
virtual void releaseVectorizer(OdGsBaseVectorizer *)
virtual OdUInt32 numVectorizers() const
virtual OdGsBaseVectorizer * getVectorizer(bool)
OdArray< OdGsViewPtr > m_vectorizers
virtual void setUp(OdGsViewImpl &view)
virtual OdRxDictionaryPtr properties()=0
ClearColor
Definition: Gs.h:920
RenderMode
Definition: Gs.h:138
const OdGePoint2d & dcScreenMin() const
Definition: GsViewImpl.h:474
OdUInt32 viewportId() const
Definition: GsViewImpl.h:240
virtual void invalidateCachedViewportGeometry()
OdGsClientViewInfo m_viewInfo
Definition: GsViewImpl.h:800
virtual OdGsDevice * device() const
bool hasLweights() const
Definition: GsViewImpl.h:471
const OdGeMatrix3d & eyeToWorldMatrix() const
Definition: GsViewImpl.h:913
virtual double getDeviation(const OdGiDeviationType deviationType, const OdGePoint3d &pointOnCurve, bool bRecalculate=false) const
bool isDependentViewportView() const
Definition: GsViewImpl.h:826
double windowAspect() const
virtual OdGePoint3d position() const
virtual OdGePoint3d target() const
virtual OdGeMatrix3d screenMatrix() const
bool isLayerVisible(OdDbStub *layerId) const
virtual void getNumPixelsInUnitSquare(const OdGePoint3d &givenWorldpt, OdGePoint2d &pixelArea, bool includePerspective=true) const
const OdGiContextualColors * contextualColors() const
Definition: GsViewImpl.h:846
void screenRectNorm(OdGsDCRect &normalizedRect) const
OdGsDCRectArray invalidRects(OdGsOverlayId nOverlay=kGsMainOverlay) const
virtual bool isValid() const
virtual void cullingVolumeTransformBy(const OdGeMatrix3d &xfm)
const OdGePoint2d & dcUpperRight() const
Definition: GsViewImpl.h:477
virtual OdGeVector3d upVector() const
double getLinetypeGenerationCriteria() const
virtual OdGsViewPtr cloneView(bool cloneViewParameters=true, bool cloneGeometry=false)
OdGeMatrix3d perspectiveMatrix() const
virtual bool cullingVolumeIntersectWithOpt(const OdGsCullingPrimitive &prim) const
void invalidateRegion(const OdGiPathNode &path)
OdGsPropertiesPtr getViewportPropertiesRoot() const
double focalLength() const
void screenRect(OdGsDCPoint &lowerLeft, OdGsDCPoint &upperRight) const
virtual bool isPerspective() const
virtual OdDbStub * visualStyle() const
virtual double lineweightToDcScale() const
double linetypeAlternateScaleMultiplier() const
virtual double lensLength() const
virtual bool isVisible()
const OdGePoint2d & dcScreenMax() const
Definition: GsViewImpl.h:475
ClearColor clearColor() const
virtual void getViewportBorderProperties(ODCOLORREF &color, int &width) const
virtual OdDbStub * background() const
virtual RenderMode mode() const
virtual OdGeMatrix3d projectionMatrix() const
const OdGeMatrix3d & worldToEyeMatrix() const
Definition: GsViewImpl.h:923
OdDbStub * getViewportObjectId() const
Definition: GsViewImpl.h:244
virtual void viewportClipRegion(OdIntArray &counts, OdGePoint2dArray &vertices) const
bool isViewportOnScreen() const
virtual void setVisualStyle(OdDbStub *visualStyleId)
const OdGeVector3d & eyeVector() const
Definition: GsViewImpl.h:395
const OdGeVector3d & xVector() const
Definition: GsViewImpl.h:396
virtual void invalidate()
virtual double frontClip() const
double getLinetypeScaleMultiplier() const
double calcDeviation(const OdGiDeviationType type, const OdGePoint3d &pt) const
OdUInt32 frozenLayers() const
Definition: GsViewImpl.h:299
virtual double fieldWidth() const
bool doPerspectivePt(OdGePoint3d &point) const
OdGsBaseVectorizeDevice * baseDevice()
Definition: GsViewImpl.h:249
virtual void getViewport(OdGePoint2d &lowerLeft, OdGePoint2d &upperRight) const
virtual bool isStereoEnabled() const
virtual bool isCullingVolumeInitialized() const
bool isRegenOnDrawForbidden() const
Definition: GsViewImpl.h:953
bool isHelperView() const
Definition: GsViewImpl.h:836
int cachedDrawables() const
Definition: GsViewImpl.h:409
virtual bool isBackClipped() const
virtual OdGeMatrix3d worldToDeviceMatrix() const
virtual bool pointInViewport(const OdGePoint2d &screenPoint) const
virtual double fieldHeight() const
double unrotatedFieldHeight() const
OdGsCullingVolumePtr cullingVolume() const
virtual OdGsCullingVolume::IntersectionStatus cullingVolumeIntersectWith(const OdGsCullingPrimitive &prim) const
virtual bool isFrontClipped() const
bool updateViewportProperties(OdUInt32 incFlags)
short viewportRotation() const
bool doInversePerspectivePt(OdGePoint3d &point) const
OdGiRegenType getRegenType() const
Definition: GsViewImpl.h:388
bool isSnapping() const
Definition: GsViewImpl.h:943
virtual double backClip() const
virtual OdGeMatrix3d viewingMatrix() const
void viewportDcCorners(OdGePoint2d &lower_left, OdGePoint2d &upper_right) const
virtual bool isViewportBorderVisible() const
bool isDependentGeometryView() const
Definition: GsViewImpl.h:831
OdGeMatrix3d eyeToScreenMatrix(OdGsOverlayId nOverlay=kGsMainOverlay) const
bool isRotated() const
Definition: GsViewImpl.h:902
OdGsPropertiesPtr getViewportPropertiesForType(OdGsProperties::PropertiesType type) const
virtual void getStereoParameters(double &magnitude, double &parallax) const
bool isCompletelyVisible() const
Definition: GsViewImpl.h:968
const OdGePoint2d & dcLowerLeft() const
Definition: GsViewImpl.h:476
const OdGeMatrix3d & rotationMatrix() const
double unrotatedFieldWidth() const
bool isNonRectClipped() const
Definition: GsViewImpl.h:897
virtual double linetypeScaleMultiplier() const
void lock()
Definition: OdMutex.h:69
void unlock()
Definition: OdMutex.h:76
OdMutex * get()
virtual OdRxObjectPtr getAt(const OdString &key) const =0
virtual bool has(const OdString &key) const =0
const T * get() const
Definition: SmartPtr.h:326
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
LineWeight
Definition: OdaDefs.h:382
@ kLnWt000
Definition: OdaDefs.h:383