CFx SDK Documentation  2020SP3
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 
496 class OdGsBaseDeviceMTSyncHelper : public OdGsBaseDeviceMTHelpers::SyncHelper
497 {
498  public:
500  : OdGsBaseDeviceMTHelpers::SyncHelper(syncPoint, syncType) {}
501 };
502 
503 #include "TD_PackPop.h"
504 
505 #endif // ODGSBASEINCLUDE_INC
OdGsViewImpl::position
virtual OdGePoint3d position() const
OdGsViewLocalId
Definition: GsViewLocalId.h:80
OdGsViewImpl::cloneView
virtual OdGsViewPtr cloneView(bool cloneViewParameters=true, bool cloneGeometry=false)
OdGsBaseDeviceMTHelpersTemplate::unlock
void unlock(OdUInt32 nSync)
Definition: GsBaseInclude.h:438
OdMutex::unlock
void unlock()
Definition: OdMutex.h:76
OdGsViewImpl::focalLength
double focalLength() const
OdGeVector3d
Definition: GeVector3d.h:54
OdGsBaseVectorizer::setUp
virtual void setUp(OdGsViewImpl &view)
OdGsViewImpl::isLayerVisible
bool isLayerVisible(OdDbStub *layerId) const
OdGsView::RenderMode
RenderMode
Definition: Gs.h:138
GsBaseVectorizeDevice.h
OdGsViewImpl::getViewport
virtual void getViewport(OdGePoint2d &lowerLeft, OdGePoint2d &upperRight) const
OdSaveStateFlag
#define OdSaveStateFlag(type, flag, name, flags, newVal)
Definition: SaveState.h:82
OdGsBaseDeviceMTHelpersTemplate::isEnabled
bool isEnabled() const
Definition: GsBaseInclude.h:431
OdGsViewImpl::screenRectNorm
void screenRectNorm(OdGsDCRect &normalizedRect) const
OdGsBaseDeviceMTHelpers::unlock
void unlock(SyncType nSync)
Definition: GsBaseInclude.h:486
OdGsBaseVectorizeViewJoinMT
Definition: GsBaseInclude.h:126
GsBaseModule.h
OdGsBaseDeviceMTHelpers::lock
void lock(SyncType nSync)
Definition: GsBaseInclude.h:485
OdGsBaseVectorizer
Definition: GsBaseVectorizer.h:112
OdGsViewImpl::getLinetypeGenerationCriteria
double getLinetypeGenerationCriteria() const
OdGsViewImpl::screenMatrix
virtual OdGeMatrix3d screenMatrix() const
OdGsViewImpl::viewportRotation
short viewportRotation() const
OdGsDCRectDouble
Definition: GsDefs.h:242
OdGsViewImpl::isPerspective
virtual bool isPerspective() const
OdGsViewImpl::clearColor
ClearColor clearColor() const
IMPL_VECTORIZER_DEFAULT
#define IMPL_VECTORIZER_DEFAULT()
Definition: GsBaseVectorizeView.h:168
OdGsBaseDeviceMTSyncHelper
Definition: GsBaseInclude.h:497
OdRxDictionary::has
virtual bool has(const OdString &key) const =0
OdGsViewImpl::projectionMatrix
virtual OdGeMatrix3d projectionMatrix() const
OdGsViewImpl::isRotated
bool isRotated() const
Definition: GsViewImpl.h:902
OdGsBaseDeviceMTHelpersTemplate::OdGsBaseDeviceMTHelpersTemplate
OdGsBaseDeviceMTHelpersTemplate()
Definition: GsBaseInclude.h:429
OdGsViewImpl::lensLength
virtual double lensLength() const
OdGsBaseVectorizeViewDef::OdGsBaseVectorizeViewDef
OdGsBaseVectorizeViewDef()
Definition: GsBaseInclude.h:394
type
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
OdGsBaseDeviceMTSyncHelper::OdGsBaseDeviceMTSyncHelper
OdGsBaseDeviceMTSyncHelper(OdGsBaseDeviceMTHelpers &syncPoint, OdGsBaseDeviceMTHelpers::SyncType syncType)
Definition: GsBaseInclude.h:499
OdGsBaseVectorizeViewJoin::lineweightToPixels
int lineweightToPixels(OdDb::LineWeight lineweight) const
Definition: GsBaseInclude.h:95
false
false
Definition: DimVarDefs.h:165
OdGsViewImpl::getViewportBorderProperties
virtual void getViewportBorderProperties(ODCOLORREF &color, int &width) const
OdGiBaseVectorizerImpl::objectToDeviceMatrix
virtual OdGeMatrix3d objectToDeviceMatrix() const
OdGsViewImpl::getStereoParameters
virtual void getStereoParameters(double &magnitude, double &parallax) const
OdGsView::ClearColor
ClearColor
Definition: Gs.h:920
OdGsViewImpl::visualStyle
virtual OdDbStub * visualStyle() const
OdGsDCRect
Definition: GsDefs.h:111
OdGsBaseVectorizeViewJoinMT::m_vectorizers
OdArray< OdGsViewPtr > m_vectorizers
Definition: GsBaseInclude.h:128
OdGsDevice
Definition: Gs.h:1061
OdGsViewImpl::getViewportPropertiesForType
OdGsPropertiesPtr getViewportPropertiesForType(OdGsProperties::PropertiesType type) const
OdGsBaseVectorizeViewJoinMT::releaseVectorizer
virtual void releaseVectorizer(OdGsBaseVectorizer *)
Definition: GsBaseInclude.h:169
OdGsViewImpl::dcUpperRight
const OdGePoint2d & dcUpperRight() const
Definition: GsViewImpl.h:477
OdGsViewImpl::getRegenType
OdGiRegenType getRegenType() const
Definition: GsViewImpl.h:388
OdGsDCPoint
Definition: GsDefs.h:53
OdGsViewImpl::cullingVolumeIntersectWithOpt
virtual bool cullingVolumeIntersectWithOpt(const OdGsCullingPrimitive &prim) const
OdArray
Definition: OdArray.h:591
OdGsViewImpl::eyeToWorldMatrix
const OdGeMatrix3d & eyeToWorldMatrix() const
Definition: GsViewImpl.h:913
OdGsBaseDeviceMTHelpers::kSyncDeviceResource
@ kSyncDeviceResource
Definition: GsBaseInclude.h:477
TD_PackPop.h
OdGsBaseVectorizeViewJoin
Definition: GsBaseInclude.h:52
OdGsBaseVectorizeViewJoinMT::isMTRegen
bool isMTRegen() const
Definition: GsBaseInclude.h:174
OdGsViewImpl::eyeToScreenMatrix
OdGeMatrix3d eyeToScreenMatrix(OdGsOverlayId nOverlay=kGsMainOverlay) const
OdGsViewImpl::isStereoEnabled
virtual bool isStereoEnabled() const
OdGsViewImpl::baseDevice
OdGsBaseVectorizeDevice * baseDevice()
Definition: GsViewImpl.h:249
OdGsViewImpl::fieldHeight
virtual double fieldHeight() const
OdGiBaseVectorizerImpl::lineweightToPixels
int lineweightToPixels(OdDb::LineWeight lineweight) const
Definition: GiBaseVectorizerImpl.h:597
OdGsViewImpl::linetypeAlternateScaleMultiplier
double linetypeAlternateScaleMultiplier() const
OdGsViewImpl::isVisible
virtual bool isVisible()
OdGsBaseDeviceMTHelpers::kSyncTextureCache
@ kSyncTextureCache
Definition: GsBaseInclude.h:479
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdGsViewImpl::frozenLayers
OdUInt32 frozenLayers() const
Definition: GsViewImpl.h:299
GsBaseVectorizer.h
OdGsViewImpl::worldToDeviceMatrix
virtual OdGeMatrix3d worldToDeviceMatrix() const
OdGsViewImpl::getDeviation
virtual double getDeviation(const OdGiDeviationType deviationType, const OdGePoint3d &pointOnCurve, bool bRecalculate=false) const
OdGsBaseDeviceMTHelpersTemplate::SyncHelper::~SyncHelper
~SyncHelper()
Definition: GsBaseInclude.h:457
OdGsBaseDeviceMTHelpersTemplate::setEnabled
void setEnabled(bool bEnable)
Definition: GsBaseInclude.h:430
OdGsViewImpl::setVisualStyle
virtual void setVisualStyle(OdDbStub *visualStyleId)
OdGsViewImpl::isCullingVolumeInitialized
virtual bool isCullingVolumeInitialized() const
OD_T
#define OD_T(x)
Definition: OdPlatformSettings.h:714
SaveState.h
OdGsBaseVectorizeViewMT
Definition: GsBaseInclude.h:405
OdGsBaseVectorizeViewJoin::updateGeometryByDevice
void updateGeometryByDevice()
Definition: GsBaseInclude.h:113
OdGsViewImpl::cullingVolumeTransformBy
virtual void cullingVolumeTransformBy(const OdGeMatrix3d &xfm)
OdGsViewImpl::cachedDrawables
int cachedDrawables() const
Definition: GsViewImpl.h:409
OdGsViewImpl::background
virtual OdDbStub * background() const
OdGsViewImpl::perspectiveMatrix
OdGeMatrix3d perspectiveMatrix() const
GsBaseVectorizeView.h
OdGsViewImpl::calcDeviation
double calcDeviation(const OdGiDeviationType type, const OdGePoint3d &pt) const
OdRxDictionary::getAt
virtual OdRxObjectPtr getAt(const OdString &key) const =0
ThreadsCounter.h
OdGsViewImpl::unrotatedFieldHeight
double unrotatedFieldHeight() const
OdGsBaseDeviceMTHelpersTemplate
Definition: GsBaseInclude.h:424
OdSmartPtr
Definition: SmartPtr.h:58
OdGsViewImpl::linetypeScaleMultiplier
virtual double linetypeScaleMultiplier() const
OdGsViewImpl::invalidateCachedViewportGeometry
virtual void invalidateCachedViewportGeometry()
OdGsViewImpl::dcScreenMin
const OdGePoint2d & dcScreenMin() const
Definition: GsViewImpl.h:474
OdGsViewImpl::eyeVector
const OdGeVector3d & eyeVector() const
Definition: GsViewImpl.h:395
OdGePoint3d
Definition: GePoint3d.h:55
OdGiVisualStyle
Definition: GiVisualStyle.h:996
OdGiPathNode
Definition: GiPathNode.h:36
OdGsViewImpl::worldToEyeMatrix
const OdGeMatrix3d & worldToEyeMatrix() const
Definition: GsViewImpl.h:923
true
true
Definition: DimVarDefs.h:2046
OdGsViewImpl::mode
virtual RenderMode mode() const
OdGsBaseDeviceMTHelpers::kSyncRasterCache
@ kSyncRasterCache
Definition: GsBaseInclude.h:478
OdGsProperties
Definition: GsProperties.h:111
OdGsViewImpl::lineweightToDcScale
virtual double lineweightToDcScale() const
OdGsBaseVectorizeView
Definition: GsBaseVectorizeView.h:53
OdMutexPtr::get
OdMutex * get()
Definition: ThreadsCounter.h:42
OdGsViewImpl::isRegenOnDrawForbidden
bool isRegenOnDrawForbidden() const
Definition: GsViewImpl.h:953
OdGsViewImpl::isDependentGeometryView
bool isDependentGeometryView() const
Definition: GsViewImpl.h:831
OdGsBaseVectorizeViewJoinMT::getVectorizer
virtual OdGsBaseVectorizer * getVectorizer(bool)
Definition: GsBaseInclude.h:148
OdGsViewImpl::getLinetypeScaleMultiplier
double getLinetypeScaleMultiplier() const
OdGsViewImpl::pointInViewport
virtual bool pointInViewport(const OdGePoint2d &screenPoint) const
OdSmartPtr::get
const T * get() const
Definition: SmartPtr.h:326
OdGsViewImpl::isViewportOnScreen
bool isViewportOnScreen() const
OdGsViewImpl::doInversePerspectivePt
bool doInversePerspectivePt(OdGePoint3d &point) const
OdGsViewImpl::contextualColors
const OdGiContextualColors * contextualColors() const
Definition: GsViewImpl.h:846
OdGsViewImpl::isHelperView
bool isHelperView() const
Definition: GsViewImpl.h:836
width
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
OdGsViewImpl::getViewportObjectId
OdDbStub * getViewportObjectId() const
Definition: GsViewImpl.h:244
OdGsBaseVectorizeViewMT::OdGsBaseVectorizeViewMT
OdGsBaseVectorizeViewMT()
Definition: GsBaseInclude.h:407
OdGsClientViewInfo::kSetViewportId
@ kSetViewportId
Definition: Gs.h:1027
OdGsCullingVolume
Definition: GsCullingVolume.h:292
OdGsViewImpl::dcLowerLeft
const OdGePoint2d & dcLowerLeft() const
Definition: GsViewImpl.h:476
OdGsViewImpl::viewportDcCorners
void viewportDcCorners(OdGePoint2d &lower_left, OdGePoint2d &upper_right) const
TD_PackPush.h
OdGsViewImpl::cullingVolume
OdGsCullingVolumePtr cullingVolume() const
OdGsViewImpl::doPerspectivePt
bool doPerspectivePt(OdGePoint3d &point) const
OdGsBaseDeviceMTHelpersTemplate::m_bEnabled
bool m_bEnabled
Definition: GsBaseInclude.h:427
OdGsBaseDeviceMTHelpers::SyncType
SyncType
Definition: GsBaseInclude.h:475
OdGsViewImpl::screenRect
void screenRect(OdGsDCPoint &lowerLeft, OdGsDCPoint &upperRight) const
OdGsBaseDeviceMTHelpersTemplate::SyncHelper
Definition: GsBaseInclude.h:448
OdGsBaseDeviceMTHelpersTemplate::SyncHelper::SyncHelper
SyncHelper(OdGsBaseDeviceMTHelpersTemplate &syncPoint, OdUInt32 syncType)
Definition: GsBaseInclude.h:452
OdGsBaseDeviceMTHelpers
Definition: GsBaseInclude.h:472
OdGsViewImpl::m_viewInfo
OdGsClientViewInfo m_viewInfo
Definition: GsViewImpl.h:800
OdDb::kLnWt000
@ kLnWt000
Definition: OdaDefs.h:383
OdGsViewImpl::viewportClipRegion
virtual void viewportClipRegion(OdIntArray &counts, OdGePoint2dArray &vertices) const
OdGiDeviationType
OdGiDeviationType
Definition: GiCommonDraw.h:64
OdGsBaseVectorizeViewJoin::OdGsBaseVectorizeViewJoin
OdGsBaseVectorizeViewJoin()
Definition: GsBaseInclude.h:54
OdRxVariantValue
Definition: RxVariantValue.h:53
OdGsCullingPrimitive
Definition: GsCullingVolume.h:51
OdGsBaseVectorizeViewJoin::clearLinetypeCache
virtual void clearLinetypeCache()
Definition: GsBaseInclude.h:61
OdGsBaseVectorizeViewJoin::objectToDeviceMatrix
OdGeMatrix3d objectToDeviceMatrix() const
Definition: GsBaseInclude.h:91
OdGsBaseVectorizeViewJoin::setVisualStyle
void setVisualStyle(const OdGiVisualStyle &visualStyle)
Definition: GsBaseInclude.h:103
OdGiBaseVectorizerImpl::view
OdGsViewImpl & view() const
Definition: GiBaseVectorizerImpl.h:63
OdGsViewImpl::viewportId
OdUInt32 viewportId() const
Definition: GsViewImpl.h:240
OdGsViewImpl::fieldWidth
virtual double fieldWidth() const
OdGsBaseModel
Definition: GsBaseModel.h:118
OdGsViewImpl::isValid
virtual bool isValid() const
OdGsViewImpl::isViewportBorderVisible
virtual bool isViewportBorderVisible() const
RxVariantValue.h
OdGsViewImpl::xVector
const OdGeVector3d & xVector() const
Definition: GsViewImpl.h:396
OdGsViewImpl::isCompletelyVisible
bool isCompletelyVisible() const
Definition: GsViewImpl.h:968
OdMutex::lock
void lock()
Definition: OdMutex.h:69
OdGsBaseVectorizeViewJoin::isSupportPlotStyles
bool isSupportPlotStyles() const
Definition: GsBaseInclude.h:107
OdGeExtents3d
Definition: GeExtents3d.h:45
OdDb::LineWeight
LineWeight
Definition: OdaDefs.h:382
OdError
Definition: OdError.h:43
OdGsViewImpl::updateViewportProperties
bool updateViewportProperties(OdUInt32 incFlags)
OdDb
Definition: Db2dPolyline.h:50
OdGsViewImpl::rotationMatrix
const OdGeMatrix3d & rotationMatrix() const
OdGsViewImpl::viewingMatrix
virtual OdGeMatrix3d viewingMatrix() const
OdGsViewImpl::hasLweights
bool hasLweights() const
Definition: GsViewImpl.h:471
OdGsViewImpl::isDependentViewportView
bool isDependentViewportView() const
Definition: GsViewImpl.h:826
OdGsViewImpl::target
virtual OdGePoint3d target() const
OdSaveState
Definition: SaveState.h:40
ODCOLORREF
#define ODCOLORREF
Definition: OdPlatform.h:883
OdGsViewImpl::cullingVolumeIntersectWith
virtual OdGsCullingVolume::IntersectionStatus cullingVolumeIntersectWith(const OdGsCullingPrimitive &prim) const
OdGsViewImpl::windowAspect
double windowAspect() const
OdGsBaseVectorizeViewJoin::lineweightToPixels
double lineweightToPixels(double lineweight) const
Definition: GsBaseInclude.h:99
OdGsViewImpl::device
virtual OdGsDevice * device() const
OdGsViewImpl::dcScreenMax
const OdGePoint2d & dcScreenMax() const
Definition: GsViewImpl.h:475
OdGsBaseDeviceMTHelpersTemplate::m_locker
OdMutexPtr m_locker[SyncCount]
Definition: GsBaseInclude.h:426
OdGiBaseVectorizerImpl::clearLinetypeCache
void clearLinetypeCache()
OdGsViewImpl::invalidRects
OdGsDCRectArray invalidRects(OdGsOverlayId nOverlay=kGsMainOverlay) const
OdMutexPtr
Definition: ThreadsCounter.h:38
OdGsBaseVectorizeViewMT::isMTView
bool isMTView() const
Definition: GsBaseInclude.h:409
OdGsViewImpl::getViewportPropertiesRoot
OdGsPropertiesPtr getViewportPropertiesRoot() const
odThreadsCounter
FIRSTDLL_EXPORT ThreadsCounter & odThreadsCounter()
OdGsDevice::properties
virtual OdRxDictionaryPtr properties()=0
OdGiRegenType
OdGiRegenType
Definition: GiCommonDraw.h:50
OdGsViewImpl::isBackClipped
virtual bool isBackClipped() const
OdGsBaseVectorizeViewJoin::ODRX_USING_HEAP_OPERATORS
ODRX_USING_HEAP_OPERATORS(BaseVectorizerObject)
OdGsBaseDeviceMTHelpers::kSyncCount
@ kSyncCount
Definition: GsBaseInclude.h:481
OdGsViewImpl::upVector
virtual OdGeVector3d upVector() const
OdGiContextualColors
Definition: GiContextualColors.h:41
OdGsBaseVectorizeViewJoinMT::numVectorizers
virtual OdUInt32 numVectorizers() const
Definition: GsBaseInclude.h:136
RxDictionary.h
OdGsViewImpl::isSnapping
bool isSnapping() const
Definition: GsViewImpl.h:943
RxObjectImpl.h
OdGsViewImpl::frontClip
virtual double frontClip() const
OdGsBaseVectorizeViewJoinMT::m_vectUsage
OdUInt32 m_vectUsage
Definition: GsBaseInclude.h:129
OdGsBaseDeviceMTHelpers::OdGsBaseDeviceMTHelpers
OdGsBaseDeviceMTHelpers()
Definition: GsBaseInclude.h:484
OdGsBaseVectorizeViewJoinMT::OdGsBaseVectorizeViewJoinMT
OdGsBaseVectorizeViewJoinMT()
Definition: GsBaseInclude.h:131
OdGsBaseVectorizeViewDef
Definition: GsBaseInclude.h:392
OdGsViewImpl::unrotatedFieldWidth
double unrotatedFieldWidth() const
OdGsViewImpl::isFrontClipped
virtual bool isFrontClipped() const
OdGiBaseVectorizerImpl::isSupportPlotStyles
bool isSupportPlotStyles() const
Definition: GiBaseVectorizerImpl.h:592
OdGsViewImpl::invalidate
virtual void invalidate()
OdGsBaseDeviceMTHelpers::kSyncDeviceAccess
@ kSyncDeviceAccess
Definition: GsBaseInclude.h:476
OdGsBaseDeviceMTHelpersTemplate::lock
void lock(OdUInt32 nSync)
Definition: GsBaseInclude.h:432
OdGsViewImpl::getNumPixelsInUnitSquare
virtual void getNumPixelsInUnitSquare(const OdGePoint3d &givenWorldpt, OdGePoint2d &pixelArea, bool includePerspective=true) const
OdGsViewImpl::isNonRectClipped
bool isNonRectClipped() const
Definition: GsViewImpl.h:897
OdGsViewImpl::invalidateRegion
void invalidateRegion(const OdGiPathNode &path)
OdGsBaseDeviceMTHelpersTemplate::check
void check(int nSyncObjects)
Definition: GsBaseInclude.h:445
OdGsViewImpl::backClip
virtual double backClip() const
OdGePoint2d
Definition: GePoint2d.h:60