9 #include "mg/drawParam.h"
10 #include "mg/object.h"
12 #include "mg/Surface.h"
13 #include "mg/FSurface.h"
14 #include "topo/Face.h"
15 #include "topo/Shell.h"
52 }
else if(p2(0) < p1(0)){
57 }
else if(p2(1) < p1(1)){
62 }
else if(p2(2) < p1(2)){
71 typedef std::map<MGPosition, int, positionComp> triangleMap;
74 typedef std::map<int, MGPosition> IndexPosMap;
77 typedef std::map<int, vertId> TriVertMap;
97 MGStl(
const std::vector<mgTL2Triangles>& tlDataVector);
115 const std::vector<MGPosition>& vertices,
116 const std::vector<int>& indices
146 std::ostream&
out(std::ostream& ostrm)
const;
200 const std::vector<MGPosition>&
positions()
const{
return m_vecPos;};
204 const std::vector<MGUnit_vector>&
normals()
const{
return m_vecNormlTriang;};
205 std::vector<MGUnit_vector>&
normals(){
return m_vecNormlTriang;};
224 const TCHAR* strFilePath
241 const TCHAR* rSTLFilePath
253 void push_back_triangle(
257 triangleMap& VertexMap
265 const std::vector<MGPosition>& vertices,
266 const std::vector<int>& indices);
269 void update_bounds();
272 void update_normals();
275 std::string
whoami()
const{
return "Stl";};
281 int SaveObjFormatFromStl(std::ofstream& fout)
const;
290 void push_back_Position(
298 void add_indices_and_calc_normal(
313 std::vector<MGPosition>& vecPos
325 std::vector<MGPosition>& vecPos
335 const std::vector<MGPosition>& vecPos
342 int IdentifyPosition(
344 triangleMap& VertexMap
350 triangleMap& VertexMap
357 triangleMap& VertexMap
369 std::vector<MGPosition> m_vecPos;
376 std::vector<MGUnit_vector> m_vecNormlTriang;
384 std::vector<int> m_indices;
MGStl(void)
デフォルトコンストラクタ
Definition: MGStl.h:81
const std::vector< MGUnit_vector > & normals() const
return the ref to m_vecPos.
Definition: MGStl.h:204
std::string whoami() const
オブジェクト名を返却する.
Definition: MGStl.h:275
MGCurve is an abstract class which represents a whole curve.
Definition: Curve.h:63
MGTransf represents a transformation of a space dimension.
Definition: Transf.h:35
virtual const MGObject * object_pointer() const =0
Get the object point of this MGFSurface.
MGisects intersection(const MGObject &obj2) const
Definition: MGStl.h:183
std::vector< MGPosition > & positions()
Definition: MGStl.h:201
virtual long identify_type() const =0
Return This object's typeID.
A vector of mgTL2Triangle's.
Definition: TL2Triangles.h:25
MGisects intersection(const MGShell &obj2) const
Definition: MGStl.h:188
const std::vector< MGPosition > & positions() const
return the ref to m_vecPos.
Definition: MGStl.h:200
MGisects intersection(const MGFSurface &obj2) const
Definition: MGStl.h:185
MGisects intersection(const MGCurve &obj2) const
Definition: MGStl.h:184
MGIfstream is a class to read the serialized data generated by MGOfstream.
Definition: Ifstream.h:30
virtual void drawWire(mgVBO &vbo, double span_length, int line_density=1) const =0
virtual void WriteMembers(MGOfstream &buf) const
Write all member data.
Is an abstract class which represents a whole geometry and a topology.
Definition: Object.h:42
MGShell is a composition of MGFace's(trimmed surface).
Definition: Shell.h:32
Vector of a general n space dimension.
Definition: Vector.h:26
int manifold_dimension() const
Get manifold dimension.
Definition: MGStl.h:191
Defines a Box of any space dimendion.
Definition: Box.h:34
Defines parameters to draw MGObject, maily to approximate by lines and facets.
Definition: drawParam.h:53
MGFace is a trimmed surface.
Definition: Face.h:51
MGisects intersection(const MGSurface &obj2) const
Definition: MGStl.h:186
virtual MGObject * clone() const =0
Represent a positional data.
Definition: Position.h:28
MGSurface is an abstract class of 3D surface.
Definition: Surface.h:54
ELEMENT_TARGET
Definition: VBO.h:84
int GetTriangleCount() const
Definition: MGStl.h:209
virtual void ReadMembers(MGIfstream &buf)
general transformation.
virtual MGObject & operator-=(const MGVector &v)=0
MGFSurface is an abstract class to provide the comman interfaces to MGFace and MGSurface.
Definition: FSurface.h:33
MGStl is a concrete class which represents an STL information.
Definition: MGStl.h:34
MGOfstream is a class to serialize all of the subclasses of MGGel.
Definition: Ofstream.h:31
std::vector< MGUnit_vector > & normals()
Definition: MGStl.h:205
virtual void shade(mgVBO &vbo, const MGDrawParam ¶, mgVBO::ELEMENT_TARGET target=mgVBO::SHADING) const
Shade the object in world coordinates.
Definition: Object.h:101
virtual std::ostream & out(std::ostream &) const
Output virtual function.
virtual void draw3DVertex(mgVBO &vbo) const =0
virtual const MGBox & box() const =0
Get the box of the object.
MGisects defines a vector of MGisect.
Definition: isects.h:44
virtual MGObject & operator+=(const MGVector &v)=0
Object transformation.
virtual MGObject & operator*=(double scale)=0
virtual bool operator==(const MGGel &gel2) const
Comparison.
Definition: Gel.h:80
mgSysGL is a class to provide a facility to draw temporal pictures.
Definition: sysGL.h:26
OpenGL 4 用描画のためのクラス, in other words, display list.
Definition: VBO.h:76
virtual MGObject & operator=(const MGObject &obj2)
Definition: Object.h:60
MGisects intersection(const MGFace &obj2) const
Definition: MGStl.h:187
virtual void display_arrows(mgSysGL &sgl) const
Definition: Gel.h:192
MGMatrix is a matix of m by m, where m is the space dimension.
Definition: Matrix.h:30