CFx SDK Documentation  2020SP3
FxGeomUtils.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2020 by Graebert GmbH.
3 //
4 // Permission to use, copy, modify, and distribute this software in
5 // object code form for any purpose and without fee is hereby granted,
6 // provided that the above copyright notice appears in all copies and
7 // that both that copyright notice and the limited warranty and
8 // restricted rights notice below appear in all supporting
9 // documentation.
10 //
11 // GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12 // GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14 // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15 // UNINTERRUPTED OR ERROR FREE.
16 
17 #pragma once
18 
19 #include "DDKERNEL.h"
20 
21 #include <IdArrays.h>
22 
23 #include <DbSubentId.h>
24 #include <DbEntity.h>
25 #include <DbCurve.h>
26 #include <DbPolyline.h>
27 #include <Db3dSolid.h>
28 
29 #include <Ge/GePoint3d.h>
30 #include <Ge/GePoint2d.h>
31 #include <Ge/GeVector3d.h>
32 #include <Ge/GeMatrix3d.h>
33 #include <Ge/GePoint3dArray.h>
34 
35 #include "FxPragmaPush.h"
36 
37 class CFxView;
38 class CFxGsNode;
39 
41 {
42 public:
47  virtual void SelectSubentsByPoint(
48  CFxView* pView,
49  CFxGsNode* p3dSolidGsNode,
50  const OdGePoint3d& ptPickPoint,
51  OdArray<OdGsMarker>& aMarkers) const = 0;
58  virtual bool GetNormalOfPlanarFace(
59  OdDb3dSolidPtr pSolid,
60  const OdDbFullSubentPath & face,
61  OdGeVector3d & normal) const = 0;
74  virtual bool GetClosestPointInFace(
75  const OdGePoint3d& pt,
76  OdDbEntityPtr pObj,
77  const OdDbFullSubentPath& face,
78  OdGePoint3d& closest,
79  OdGeVector3d& Utangent,
80  OdGeVector3d& Vtangent) const = 0;
81 
82  //Description:
95  virtual bool shootRayAgainstObject(
96  OdDbEntityPtr pObj,
97  double tol,
98  const OdGePoint3d& base,
99  const OdGeVector3d& viewDir,
100  OdArray<OdDbSubentId>& subEntIds,
101  OdGeDoubleArray& parameters) const = 0;
102  //Description:
116  virtual bool shootRayAgainstObject(
117  OdDbEntityPtr pObj,
118  double tol,
119  const OdGePoint3d& base,
120  const OdGeVector3d& viewDir,
121  OdArray<OdDbSubentId>& subEntIds,
122  OdGePoint3d& pickPoint) const = 0;
123 
124  // Description:
139  std::vector<OdDbEntityPtr> pObjs,
140  double tol,
141  const OdGePoint3d& base,
142  const OdGeVector3d& viewDir,
143  int& index,
144  OdArray<OdDbSubentId>& subEntIds,
145  OdGeDoubleArray& parameters) const = 0;
146  // Description:
162  std::vector<OdDbEntityPtr> pObjs,
163  double tol,
164  const OdGePoint3d & base,
165  const OdGeVector3d& viewDir,
166  int & index,
167  OdArray<OdDbSubentId> & subEntIds,
168  OdGePoint3d & pickPoint) const = 0;
169 
170  // Description:
186  std::vector<OdDbEntityPtr> pObjs,
187  double tol,
188  const OdGePoint3d& base,
189  const OdGeVector3d& viewDir,
190  int& index, // index of corresponding solid
191  OdArray<OdDbSubentId>& subEntIds,
192  OdArray<OdGePoint3d>& pickPoints ) const = 0;
193 
194  // Description:
211  std::vector<OdDbEntityPtr> pObjs,
212  double tol,
213  const OdGePoint3d & base,
214  const OdGeVector3d& viewDir,
215  int& index, // index of corresponding solid
216  OdArray<OdDbSubentId>& subEntIds,
217  OdGeDoubleArray& parameters ) const = 0;
218 
219  //Description:
230  virtual bool SelectEdgeOnFace(CFxView* pView,
231  CFxGsNode* p3dSolidGsNode,
232  const OdGePoint3d& ptPickPoint,
233  const OdGsMarker& faceId,
234  OdGsMarker& edgeId) const = 0;
235 
236  //Description:
245  virtual bool GetEdgesFromFace(
246  OdDb3dSolidPtr p3dSolid,
247  const OdDbFullSubentPath & face,
248  OdDbFullSubentPathArray & edgePaths) const = 0;
249 
255 
257  static OdGePoint3dArray GetImageBoundary(const OdGeMatrix3d& mPixelToModel, const OdGePoint2d* uvBoundary, OdUInt32 numBoundPts);
258 
260  static OdGeMatrix3d GetPixelToModelTransform(const OdGePoint3d& origin, const OdGeVector3d& u, const OdGeVector3d& v, double ySize);
261 
262 
264  static OdDbEntityPtr GetPolySegment(const OdDbEntityPtr pPoly, const OdGePoint3d& pickPoint);
265  static bool GetSegmentAtPoint(OdDbCurvePtr pPLine, const OdGePoint3d pointOnPLine, OdGeCircArc3d &circ, OdGeLineSeg3d &line, bool& isArc, bool& isLine);
267 };
268 
269 namespace FxHLR
270 {
272  {
273  public:
274  virtual ~IHLData();
275  virtual OdDbObjectPtr GetEntity() const = 0;
276  virtual int GetFlags() const = 0;
277 
278  struct IHLOriginal
279  {
280  virtual ~IHLOriginal();
281  virtual OdDbObjectPtr GetEntity() const = 0;
282  virtual OdDbSubentId GetSubEntity() const = 0;
283  };
285  virtual const OdArray<IHLOriginalPtr>& GetOriginalEntities() const = 0;
286  };
288 
290  const OdGePoint3d& eye_pos, const OdGePoint3d& target_pos, bool bPersepcitveProjection, OdArray<IHLDataPtr>& output);
291 }
292 
293 #include "FxPragmaPop.h"
OdResult
OdResult
Definition: OdResult.h:29
FxPragmaPop.h
DbPolyline.h
OdGeVector3d
Definition: GeVector3d.h:54
CFxGeomUtils::ConvertToStdPolyline
static OdDbPolylinePtr ConvertToStdPolyline(OdDbCurvePtr pCurve)
CFxGeomUtils::GetEdgesFromFace
virtual bool GetEdgesFromFace(OdDb3dSolidPtr p3dSolid, const OdDbFullSubentPath &face, OdDbFullSubentPathArray &edgePaths) const =0
CFxGeomUtils::shootRayAgainstObject
virtual bool shootRayAgainstObject(OdDbEntityPtr pObj, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, OdArray< OdDbSubentId > &subEntIds, OdGeDoubleArray &parameters) const =0
FxHLR::IHLData::GetEntity
virtual OdDbObjectPtr GetEntity() const =0
FxHLR::IHLData::GetOriginalEntities
virtual const OdArray< IHLOriginalPtr > & GetOriginalEntities() const =0
tol
tol
Definition: DimVarDefs.h:2287
IdArrays.h
CFxGeomUtils::GetClosestPointInFace
virtual bool GetClosestPointInFace(const OdGePoint3d &pt, OdDbEntityPtr pObj, const OdDbFullSubentPath &face, OdGePoint3d &closest, OdGeVector3d &Utangent, OdGeVector3d &Vtangent) const =0
FxHLR::IHLData::GetFlags
virtual int GetFlags() const =0
CFxGeomUtils::GetSegmentAtPoint
static bool GetSegmentAtPoint(OdDbCurvePtr pPLine, const OdGePoint3d pointOnPLine, OdGeCircArc3d &circ, OdGeLineSeg3d &line, bool &isArc, bool &isLine)
OdSharedPtr
Definition: SharedPtr.h:49
Db3dSolid.h
FxHLR::IHLData::IHLOriginal::GetEntity
virtual OdDbObjectPtr GetEntity() const =0
OdDbFullSubentPath
Definition: DbSubentId.h:49
GePoint3dArray.h
FxHLR::IHLData::IHLOriginalPtr
OdSharedPtr< IHLOriginal > IHLOriginalPtr
Definition: FxGeomUtils.h:284
DDKERNEL.h
OdArray
Definition: OdArray.h:591
FxHLR::IHLData::IHLOriginal::GetSubEntity
virtual OdDbSubentId GetSubEntity() const =0
CFxGeomUtils::shootRayToGetMultipleSubEntities
virtual bool shootRayToGetMultipleSubEntities(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdGeDoubleArray &parameters) const =0
FxHLR::IHLData
Definition: FxGeomUtils.h:272
FxHLR::IHLData::IHLOriginal
Definition: FxGeomUtils.h:279
OdGsMarker
ptrdiff_t OdGsMarker
Definition: OdPlatformSettings.h:889
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
FxHLR::FlatShotHL
DDKERNEL_API OdResult FlatShotHL(const OdDbEntityPtrArray &input, const OdGePoint3d &eye_pos, const OdGePoint3d &target_pos, bool bPersepcitveProjection, OdArray< IHLDataPtr > &output)
FxHLR
Definition: FxGeomUtils.h:270
index
GLuint index
Definition: gles2_ext.h:265
CFxGeomUtils::shootRayToGetMultipleSubEntities
virtual bool shootRayToGetMultipleSubEntities(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdArray< OdGePoint3d > &pickPoints) const =0
OdSmartPtr
Definition: SmartPtr.h:58
OdGePoint3d
Definition: GePoint3d.h:55
DbEntity.h
CFxGeomUtils::shootRayAgainstObject
virtual bool shootRayAgainstObject(OdDbEntityPtr pObj, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, OdArray< OdDbSubentId > &subEntIds, OdGePoint3d &pickPoint) const =0
DbCurve.h
GePoint3d.h
FxHLR::IHLData::IHLOriginal::~IHLOriginal
virtual ~IHLOriginal()
v
const GLfloat * v
Definition: gles2_ext.h:315
DDKERNEL_API
#define DDKERNEL_API
Definition: DDKERNEL.h:32
CFxView
Definition: FxView.h:265
CFxGeomUtils::GetPolySegment
static OdDbEntityPtr GetPolySegment(const OdDbEntityPtr pPoly, const OdGePoint3d &pickPoint)
GeVector3d.h
CFxGeomUtils::GetImageBoundary
static OdGePoint3dArray GetImageBoundary(const OdGeMatrix3d &mPixelToModel, const OdGePoint2d *uvBoundary, OdUInt32 numBoundPts)
CFxGeomUtils::SelectEdgeOnFace
virtual bool SelectEdgeOnFace(CFxView *pView, CFxGsNode *p3dSolidGsNode, const OdGePoint3d &ptPickPoint, const OdGsMarker &faceId, OdGsMarker &edgeId) const =0
CFxGeomUtils::GetTransform
static OdGeMatrix3d GetTransform(const OdDbFullSubentPath &path)
CFxGeomUtils::SelectSubentsByPoint
virtual void SelectSubentsByPoint(CFxView *pView, CFxGsNode *p3dSolidGsNode, const OdGePoint3d &ptPickPoint, OdArray< OdGsMarker > &aMarkers) const =0
CFxGeomUtils::shootRayAgainstArrayObjects
virtual bool shootRayAgainstArrayObjects(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdGePoint3d &pickPoint) const =0
FxHLR::IHLDataPtr
OdSharedPtr< IHLData > IHLDataPtr
Definition: FxGeomUtils.h:287
OdGeLineSeg3d
Definition: GeLineSeg3d.h:44
CFxGeomUtils::GetPixelToModelTransform
static OdGeMatrix3d GetPixelToModelTransform(const OdGePoint3d &origin, const OdGeVector3d &u, const OdGeVector3d &v, double ySize)
CFxGeomUtils::GetTransform
static OdGeMatrix3d GetTransform(const OdDbObjectIdArray &idArray)
CFxGeomUtils::shootRayAgainstArrayObjects
virtual bool shootRayAgainstArrayObjects(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdGeDoubleArray &parameters) const =0
FxPragmaPush.h
GeMatrix3d.h
DbSubentId.h
GePoint2d.h
CFxGeomUtils
Definition: FxGeomUtils.h:41
CFxGeomUtils::GetNormalOfPlanarFace
virtual bool GetNormalOfPlanarFace(OdDb3dSolidPtr pSolid, const OdDbFullSubentPath &face, OdGeVector3d &normal) const =0
OdGeCircArc3d
Definition: GeCircArc3d.h:48
FxHLR::IHLData::~IHLData
virtual ~IHLData()
OdDbSubentId
Definition: DbBaseSubentId.h:72
OdGePoint2d
Definition: GePoint2d.h:60