CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
GsBaseVectorizeView.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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{
54public:
59
64
65public:
75
85 virtual OdGiContext* userGiContext() const;
86
92 virtual void setUserGiContext(OdGiContext* pUserGiContext);
93
97 virtual void update();
98
108 virtual void select(const OdGePoint2d* aPtDc, int numPoints, OdGsSelectionReactor* pReactor,
111
119 virtual bool viewExtents(OdGeBoundBlock3d& extents) const;
120
129 bool sceneDept(double& zNear, double& zFar, OdGsOverlayId nOverlay) const;
130
142 bool sceneDept(double& zNear, double& zFar) const;
143
159 virtual void collide( OdGiPathNode const*const* pInputList, OdUInt32 nInputListSize, OdGsCollisionDetectionReactor* pReactor, OdGiPathNode const*const* pCollisionWithList = NULL, OdUInt32 nCollisionWithListSize = 0, const OdGsCollisionDetectionContext* pCtx = NULL );
161protected:
162
164
167public:
171 virtual OdUInt32 numVectorizers() const = 0;
172
173protected:
174 virtual OdGsBaseVectorizer* getVectorizer(bool bDisplay) = 0;
175 virtual void releaseVectorizer(OdGsBaseVectorizer* pVect) = 0;
176
177 virtual void updateGeometry();
178 virtual void updateScreen();
179
180private:
181 void setVectThreadIndex(OdGsBaseVectorizer* pVect, bool bAssignIndex, int idx = -1);
182
183 //data
184protected:
186
187private:
189 friend class VectorizerAutoPtr;
190 friend class BaseVectScheduler;
191};
192
194{
195 return static_cast<OdGsBaseVectorizeView*>(OdSmartPtr<OdGsViewImpl>(pView).get());
196}
197
205{
206public:
213 VectorizerAutoPtr(OdGsBaseVectorizeView& view, bool bDisplay): m_view(view), m_obj(NULL)
214 {
215 m_obj = m_view.getVectorizer(bDisplay);
216 if(m_obj && bDisplay)
217 m_view.setVectThreadIndex(m_obj, true);
218 }
219
227 {
228 if(m_obj)
229 {
230 m_view.setVectThreadIndex(m_obj, false);
232 }
233 }
234
239 {
240 return static_cast<OdGsBaseVectorizer*>(m_obj);
241 }
242
247 {
248 return const_cast<const OdGsBaseVectorizer*>(m_obj);
249 }
250
254 const OdGsBaseVectorizer* get() const
255 {
256 return const_cast<const OdGsBaseVectorizer*>(m_obj);
257 }
258
263 {
264 return static_cast<OdGsBaseVectorizer*>(m_obj);
265 }
266
267protected:
270};
271
272#include "TD_PackPop.h"
273
274#define IMPL_VECTORIZER_DEFAULT()\
275 virtual OdUInt32 numVectorizers() const { return 1; }\
276 virtual OdGsBaseVectorizer* getVectorizer(bool /*bDisplay*/)\
277 { return this; }\
278 virtual void releaseVectorizer(OdGsBaseVectorizer* pVect)\
279 {ODA_ASSERT(pVect == (OdGsBaseVectorizer*)this); }
280
281#define IMPL_VECTORIZER_DEFAULT_EX()\
282 IMPL_VECTORIZER_DEFAULT()\
283 virtual void clearLinetypeCache(){ OdGiBaseVectorizerImpl::clearLinetypeCache(); }\
284 ODRX_USING_HEAP_OPERATORS(OdGiBaseVectorizer);
285
286#endif // ODGSBASEVECTORIZEVIEW_INC
#define GS_TOOLKIT_EXPORT
Definition: GsExport.h:37
OdGsOverlayId
Definition: GsOverlayDefs.h:42
unsigned int OdUInt32
virtual OdGsBaseVectorizer * getVectorizer(bool bDisplay)=0
TD_USING(OdGsViewImpl::collide)
bool sceneDept(double &zNear, double &zFar, OdGsOverlayId nOverlay) const
virtual void select(const OdGePoint2d *aPtDc, int numPoints, OdGsSelectionReactor *pReactor, OdGsView::SelectionMode mode=OdGsView::kCrossing)
static OdGsBaseVectorizeView * safeCast(OdGsView *pView)
virtual void collide(OdGiPathNode const *const *pInputList, OdUInt32 nInputListSize, OdGsCollisionDetectionReactor *pReactor, OdGiPathNode const *const *pCollisionWithList=NULL, OdUInt32 nCollisionWithListSize=0, const OdGsCollisionDetectionContext *pCtx=NULL)
virtual void updateGeometry()
virtual OdGiContext * userGiContext() const
virtual void setUserGiContext(OdGiContext *pUserGiContext)
virtual void releaseVectorizer(OdGsBaseVectorizer *pVect)=0
virtual OdUInt32 numVectorizers() const =0
virtual void update()
OdSmartPtr< OdGiContext > m_userGiContext
bool sceneDept(double &zNear, double &zFar) const
virtual bool viewExtents(OdGeBoundBlock3d &extents) const
virtual void updateGeometryByDevice()
virtual void updateScreen()
TD_USING(OdGsViewImpl::select)
Definition: Gs.h:140
SelectionMode
Definition: Gs.h:173
@ kCrossing
Definition: Gs.h:175
virtual void select(const OdGsDCPoint *points, int numPoints, OdGsSelectionReactor *pReactor, SelectionMode mode=kCrossing)
static OdGsViewImpl * safeCast(OdGsView *pView)
Definition: GsViewImpl.h:2348
virtual void collide(OdGiPathNode const *const *pInputList, OdUInt32 nInputListSize, OdGsCollisionDetectionReactor *pReactor, OdGiPathNode const *const *pCollisionWithList=NULL, OdUInt32 nCollisionWithListSize=0, const OdGsCollisionDetectionContext *pCtx=NULL)=0
const T * get() const
Definition: SmartPtr.h:339
OdGsBaseVectorizer * m_obj
OdGsBaseVectorizer * get()
VectorizerAutoPtr(OdGsBaseVectorizeView &view, bool bDisplay)
OdGsBaseVectorizer * operator->()
OdGsBaseVectorizeView & m_view
const OdGsBaseVectorizer * get() const