IMesh.h
Go to the documentation of this file.
1 /********************************************************************
2 *
3 * Project Artec 3D Scanning SDK
4 *
5 * Purpose: 3D mesh interface implementation - geometry only.
6 *
7 * Copyright: Artec Group
8 *
9 ********************************************************************/
10 
11 #ifndef _IMESH_H_
12 #define _IMESH_H_
13 
14 #include <artec/sdk/base/IBlob.h>
15 #include <artec/sdk/base/IArray.h>
18 
19 namespace artec { namespace sdk { namespace base
20 {
21 
22 class IImage;
23 
24 class IMesh : public IRevision
25 {
26 public:
27  /// Data access functions
28  virtual IArrayPoint3F* getPoints() const = 0;
29  virtual void setPoints(IArrayPoint3F* points) = 0;
30 
31  virtual IArrayIndexTriplet* getTriangles() const = 0;
32  virtual void setTriangles(IArrayIndexTriplet* triangles) = 0;
33 
34  virtual IArrayPoint3F* getPointsNormals() const = 0;
35  virtual void setPointsNormals(IArrayPoint3F* normals) = 0;
36 
37  virtual IArrayPoint3F* getTrianglesNormals() const = 0;
38  virtual void setTrianglesNormals(IArrayPoint3F* normals) = 0;
39 
40  /// Return points coordinates for i'th triangle
41  virtual Triangle getTriangle(int i) const = 0;
42 
43  /// Create calculated data
44  virtual unsigned int calculate(unsigned int requested_mode, unsigned int recreate_mode = CM_None) = 0;
45  virtual unsigned int getCalculated() = 0;
46 
47  /**
48  * Clear unneeded data from mesh. Will not cause dependent data to be cleared.
49  * @param requested_mode - request to clear information. Modes can be combined
50  */
51  virtual void clear(int requested_mode = CM_ClearEverything) = 0;
52 
53  /// Full transformation (motion - scale)
54  virtual void transform(const Matrix4x4D& matrix) = 0;
55 
56  /// Translation
57  virtual void translate(const Point3F & direction) = 0;
58 
59  /// Rotation
60  virtual void rotate(const Matrix4x4D& matrix) = 0;
61 
62  /// Scale
63  virtual void scale(float factor) = 0;
64  virtual void scale(float factor, const Point3F & center) = 0;
65 
66  /// Calculated data access functions
67  virtual const IArrayPoint3F* getTrianglesCenters() const = 0;
68  virtual const IArrayPoint3F* getTrianglesAngles() const = 0;
69  virtual const IArrayFloat* getTrianglesAreas() const = 0;
70  virtual const IArrayPoint3F* getEdgeLengths() const = 0;
71 
72  /// Check if mesh empty
73  virtual bool isEmpty() const = 0;
74 
75  /// @name Check calculated data existence
76  ///@{
77  virtual bool hasNormals() const = 0;
78  virtual bool hasPointsNormals() const = 0;
79  virtual bool hasTrianglesNormals() const = 0;
80 
81  virtual bool hasTrianglesCenters() const = 0;
82  virtual bool hasTrianglesAngles() const = 0;
83  virtual bool hasTrianglesAreas() const = 0;
84  virtual bool hasEdgeLengths() const = 0;
85  ///@}
86 
87  /// set/get some internal data for compatibility with existing code
88  virtual void setInternalData(void* p) = 0;
89  virtual void* getInternalData() const = 0;
90 };
91 
92 } } } // namespace artec::sdk::base
93 
94 #endif // _IMESH_H_
virtual void setPointsNormals(IArrayPoint3F *normals)=0
virtual void translate(const Point3F &direction)=0
Translation.
virtual void setTriangles(IArrayIndexTriplet *triangles)=0
virtual void setTrianglesNormals(IArrayPoint3F *normals)=0
virtual const IArrayPoint3F * getTrianglesAngles() const =0
virtual Triangle getTriangle(int i) const =0
Return points coordinates for i'th triangle.
virtual bool hasEdgeLengths() const =0
virtual bool isEmpty() const =0
Check if mesh empty.
virtual void setInternalData(void *p)=0
set/get some internal data for compatibility with existing code
virtual bool hasTrianglesNormals() const =0
virtual IArrayPoint3F * getTrianglesNormals() const =0
virtual void scale(float factor)=0
Scale.
virtual bool hasTrianglesAreas() const =0
virtual bool hasTrianglesAngles() const =0
virtual const IArrayPoint3F * getTrianglesCenters() const =0
Calculated data access functions.
virtual IArrayIndexTriplet * getTriangles() const =0
virtual const IArrayFloat * getTrianglesAreas() const =0
virtual bool hasTrianglesCenters() const =0
virtual unsigned int calculate(unsigned int requested_mode, unsigned int recreate_mode=CM_None)=0
Create calculated data.
virtual IArrayPoint3F * getPointsNormals() const =0
virtual unsigned int getCalculated()=0
virtual bool hasPointsNormals() const =0
virtual void setPoints(IArrayPoint3F *points)=0
virtual void transform(const Matrix4x4D &matrix)=0
Full transformation (motion - scale)
virtual void * getInternalData() const =0
virtual void clear(int requested_mode=CM_ClearEverything)=0
virtual bool hasNormals() const =0
virtual void rotate(const Matrix4x4D &matrix)=0
Rotation.
virtual const IArrayPoint3F * getEdgeLengths() const =0
virtual IArrayPoint3F * getPoints() const =0
Data access functions.