CFx SDK Documentation  2023 SP0
FxGeomUtils.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2022 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"
#define DDKERNEL_API
Definition: DDKERNEL.h:32
tol
Definition: DimVarDefs.h:2287
ptrdiff_t OdGsMarker
unsigned int OdUInt32
OdResult
Definition: OdResult.h:29
static OdGeMatrix3d GetPixelToModelTransform(const OdGePoint3d &origin, const OdGeVector3d &u, const OdGeVector3d &v, double ySize)
virtual bool GetNormalOfPlanarFace(OdDb3dSolidPtr pSolid, const OdDbFullSubentPath &face, OdGeVector3d &normal) const =0
virtual bool GetClosestPointInFace(const OdGePoint3d &pt, OdDbEntityPtr pObj, const OdDbFullSubentPath &face, OdGePoint3d &closest, OdGeVector3d &Utangent, OdGeVector3d &Vtangent) const =0
virtual bool shootRayToGetMultipleSubEntities(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdGeDoubleArray &parameters) const =0
virtual bool shootRayAgainstObject(OdDbEntityPtr pObj, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, OdArray< OdDbSubentId > &subEntIds, OdGePoint3d &pickPoint) const =0
virtual bool shootRayAgainstObject(OdDbEntityPtr pObj, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, OdArray< OdDbSubentId > &subEntIds, OdGeDoubleArray &parameters) const =0
virtual void SelectSubentsByPoint(CFxView *pView, CFxGsNode *p3dSolidGsNode, const OdGePoint3d &ptPickPoint, OdArray< OdGsMarker > &aMarkers) const =0
static OdDbEntityPtr GetPolySegment(const OdDbEntityPtr pPoly, const OdGePoint3d &pickPoint)
virtual bool GetEdgesFromFace(OdDb3dSolidPtr p3dSolid, const OdDbFullSubentPath &face, OdDbFullSubentPathArray &edgePaths) const =0
static OdDbPolylinePtr ConvertToStdPolyline(OdDbCurvePtr pCurve)
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
virtual bool SelectEdgeOnFace(CFxView *pView, CFxGsNode *p3dSolidGsNode, const OdGePoint3d &ptPickPoint, const OdGsMarker &faceId, OdGsMarker &edgeId) const =0
virtual bool shootRayAgainstArrayObjects(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdGePoint3d &pickPoint) const =0
static OdGeMatrix3d GetTransform(const OdDbFullSubentPath &path)
static OdGeMatrix3d GetTransform(const OdDbObjectIdArray &idArray)
static bool GetSegmentAtPoint(OdDbCurvePtr pPLine, const OdGePoint3d pointOnPLine, OdGeCircArc3d &circ, OdGeLineSeg3d &line, bool &isArc, bool &isLine)
virtual bool shootRayAgainstArrayObjects(std::vector< OdDbEntityPtr > pObjs, double tol, const OdGePoint3d &base, const OdGeVector3d &viewDir, int &index, OdArray< OdDbSubentId > &subEntIds, OdGeDoubleArray &parameters) const =0
static OdGePoint3dArray GetImageBoundary(const OdGeMatrix3d &mPixelToModel, const OdGePoint2d *uvBoundary, OdUInt32 numBoundPts)
virtual int GetFlags() const =0
OdSharedPtr< IHLOriginal > IHLOriginalPtr
Definition: FxGeomUtils.h:284
virtual const OdArray< IHLOriginalPtr > & GetOriginalEntities() const =0
virtual ~IHLData()
virtual OdDbObjectPtr GetEntity() const =0
GLuint index
Definition: gles2_ext.h:265
const GLfloat * v
Definition: gles2_ext.h:315
OdSharedPtr< IHLData > IHLDataPtr
Definition: FxGeomUtils.h:287
DDKERNEL_API OdResult FlatShotHL(const OdDbEntityPtrArray &input, const OdGePoint3d &eye_pos, const OdGePoint3d &target_pos, bool bPersepcitveProjection, OdArray< IHLDataPtr > &output)
virtual OdDbSubentId GetSubEntity() const =0
virtual OdDbObjectPtr GetEntity() const =0