CFx SDK Documentation  2020SP3
GsBaseVectorizeView.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 ODGSBASEVECTORIZEVIEW_INC
25 #define ODGSBASEVECTORIZEVIEW_INC
26 
27 #include "TD_PackPush.h"
28 
29 #include <stdlib.h>
30 #include <utility>
31 
32 #include "Gs/GsViewImpl.h"
33 #include "Ge/GeExtents3d.h"
34 #include "Gs/GsViewPropsDef.h"
36 
53 {
54 public:
57 
58 public:
67  static OdGsBaseVectorizeView* safeCast(OdGsView* pView);
68 
71  virtual OdGiContext* userGiContext() const;
72  virtual void setUserGiContext(OdGiContext* pUserGiContext);
73  virtual void update();
74 
75  virtual void select(const OdGePoint2d* aPtDc, int numPoints, OdGsSelectionReactor* pReactor,
78 
79  virtual bool viewExtents(OdGeBoundBlock3d& extents) const;
80 
81  bool sceneDept(double& zNear, double& zFar, OdGsOverlayId nOverlay) const;
82  bool sceneDept(double& zNear, double& zFar) const;
83 
84 protected:
85 
86  virtual void updateGeometryByDevice();
87 
90 public:
91  virtual OdUInt32 numVectorizers() const = 0;
92 
93 protected:
94  virtual OdGsBaseVectorizer* getVectorizer(bool bDisplay) = 0;
95  virtual void releaseVectorizer(OdGsBaseVectorizer* pVect) = 0;
96 
97  virtual void updateGeometry();
98  virtual void updateScreen();
99 
100 private:
101  void setVectThreadIndex(OdGsBaseVectorizer* pVect, bool bAssignIndex, int idx = -1);
102 
103  //data
104 protected:
106 
107 private:
109  friend class VectorizerAutoPtr;
110  friend class BaseVectScheduler;
111 };
112 
114 {
115  return static_cast<OdGsBaseVectorizeView*>(OdSmartPtr<OdGsViewImpl>(pView).get());
116 }
117 
125 {
126 public:
127  VectorizerAutoPtr(OdGsBaseVectorizeView& view, bool bDisplay): m_view(view), m_obj(NULL)
128  {
129  m_obj = m_view.getVectorizer(bDisplay);
130  if(m_obj && bDisplay)
131  m_view.setVectThreadIndex(m_obj, true);
132  }
134  {
135  if(m_obj)
136  {
137  m_view.setVectThreadIndex(m_obj, false);
139  }
140  }
142  {
143  return static_cast<OdGsBaseVectorizer*>(m_obj);
144  }
145 
147  {
148  return const_cast<const OdGsBaseVectorizer*>(m_obj);
149  }
150 
151  const OdGsBaseVectorizer* get() const
152  {
153  return const_cast<const OdGsBaseVectorizer*>(m_obj);
154  }
155 
157  {
158  return static_cast<OdGsBaseVectorizer*>(m_obj);
159  }
160 
161 protected:
164 };
165 
166 #include "TD_PackPop.h"
167 
168 #define IMPL_VECTORIZER_DEFAULT()\
169  virtual OdUInt32 numVectorizers() const { return 1; }\
170  virtual OdGsBaseVectorizer* getVectorizer(bool /*bDisplay*/)\
171  { return this; }\
172  virtual void releaseVectorizer(OdGsBaseVectorizer* pVect)\
173  {ODA_ASSERT(pVect == (OdGsBaseVectorizer*)this); }
174 
175 #define IMPL_VECTORIZER_DEFAULT_EX()\
176  IMPL_VECTORIZER_DEFAULT()\
177  virtual void clearLinetypeCache(){ OdGiBaseVectorizerImpl::clearLinetypeCache(); }\
178  ODRX_USING_HEAP_OPERATORS(OdGiBaseVectorizer);
179 
180 #endif // ODGSBASEVECTORIZEVIEW_INC
OdGiContext
Definition: GiCommonDraw.h:108
NULL
#define NULL
Definition: GsProperties.h:177
GsBaseVectorizeDevice.h
OdGsBaseVectorizeView::OdGsBaseVectorizeView
OdGsBaseVectorizeView()
OdGsViewImpl::safeCast
static OdGsViewImpl * safeCast(OdGsView *pView)
Definition: GsViewImpl.h:933
OdGsBaseVectorizeView::~OdGsBaseVectorizeView
~OdGsBaseVectorizeView()
OdGsBaseVectorizer
Definition: GsBaseVectorizer.h:112
OdGsView
Definition: Gs.h:133
OdGsBaseVectorizeView::select
virtual void select(const OdGePoint2d *aPtDc, int numPoints, OdGsSelectionReactor *pReactor, OdGsView::SelectionMode mode=OdGsView::kCrossing)
OdGsBaseVectorizeView::update
virtual void update()
VectorizerAutoPtr::m_view
OdGsBaseVectorizeView & m_view
Definition: GsBaseVectorizeView.h:162
OdGsBaseVectorizeView::updateGeometryByDevice
virtual void updateGeometryByDevice()
GeExtents3d.h
OdGsBaseVectorizeView::viewExtents
virtual bool viewExtents(OdGeBoundBlock3d &extents) const
OdGsBaseVectorizeView::getVectorizer
virtual OdGsBaseVectorizer * getVectorizer(bool bDisplay)=0
TD_PackPop.h
GsViewPropsDef.h
VectorizerAutoPtr::operator->
OdGsBaseVectorizer * operator->()
Definition: GsBaseVectorizeView.h:141
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
VectorizerAutoPtr::VectorizerAutoPtr
VectorizerAutoPtr(OdGsBaseVectorizeView &view, bool bDisplay)
Definition: GsBaseVectorizeView.h:127
VectorizerAutoPtr::~VectorizerAutoPtr
~VectorizerAutoPtr()
Definition: GsBaseVectorizeView.h:133
OdGsView::SelectionMode
SelectionMode
Definition: Gs.h:157
OdGsBaseVectorizeView::setUserGiContext
virtual void setUserGiContext(OdGiContext *pUserGiContext)
OdGsBaseVectorizeView::safeCast
static OdGsBaseVectorizeView * safeCast(OdGsView *pView)
Definition: GsBaseVectorizeView.h:113
OdGsBaseVectorizeView::sceneDept
bool sceneDept(double &zNear, double &zFar) const
OdSmartPtr< OdGiContext >
OdGsBaseVectorizeView::releaseVectorizer
virtual void releaseVectorizer(OdGsBaseVectorizer *pVect)=0
OdGsBaseVectorizeView
Definition: GsBaseVectorizeView.h:53
GsViewImpl.h
VectorizerAutoPtr::get
const OdGsBaseVectorizer * get() const
Definition: GsBaseVectorizeView.h:151
OdGsViewImpl
Definition: GsViewImpl.h:58
OdSmartPtr::get
const T * get() const
Definition: SmartPtr.h:326
OdGsBaseVectorizeView::m_userGiContext
OdSmartPtr< OdGiContext > m_userGiContext
Definition: GsBaseVectorizeView.h:105
OdGsBaseVectorizeView::TD_USING
TD_USING(OdGsViewImpl::select)
TD_PackPush.h
VectorizerAutoPtr
Definition: GsBaseVectorizeView.h:125
OdGsBaseVectorizeView::updateGeometry
virtual void updateGeometry()
OdGsBaseVectorizeDevice
Definition: GsBaseVectorizeDevice.h:69
OdGsBaseVectorizeView::numVectorizers
virtual OdUInt32 numVectorizers() const =0
OdGsBaseVectorizeView::updateScreen
virtual void updateScreen()
OdGeBoundBlock3d
Definition: GeBoundBlock3d.h:43
OdGsOverlayId
OdGsOverlayId
Definition: GsOverlayDefs.h:40
OdGsBaseVectorizeView::sceneDept
bool sceneDept(double &zNear, double &zFar, OdGsOverlayId nOverlay) const
VectorizerAutoPtr::get
OdGsBaseVectorizer * get()
Definition: GsBaseVectorizeView.h:156
GS_TOOLKIT_EXPORT
#define GS_TOOLKIT_EXPORT
Definition: GsExport.h:37
OdGsBaseVectorizeView::userGiContext
virtual OdGiContext * userGiContext() const
OdGsViewImpl::select
virtual void select(const OdGsDCPoint *points, int numPoints, OdGsSelectionReactor *pReactor, SelectionMode mode=kCrossing)
VectorizerAutoPtr::m_obj
OdGsBaseVectorizer * m_obj
Definition: GsBaseVectorizeView.h:163
OdGsView::kCrossing
@ kCrossing
Definition: Gs.h:159
OdGsSelectionReactor
Definition: GsSelectionReactor.h:128
OdGePoint2d
Definition: GePoint2d.h:60