Hi!
Here are the headers. There seems like I did a poor job explaining the class tree. So here is the actual tree. The class I called Polygon is actually called PolygonMesh and Contour is called ContourMesh.
There are two classes in between called Geometrical and Renderable.
Thing <-- Geometrical <-- Renderable <-- ContourMesh
Thing <-- Geometrical <-- Renderable <-- PolygonMesh
The headers of Thing, ContourMesh ( previously called Contour ) and PolygonMesh ( previously called Polygon ) is posted bellow. Since I don't know what you're looing for I've tried to remove as little as possible.
pir
Base class Thing:
#ifndef THING_HEADERFILE041205
#define THING_HEADERFILE041205
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <vector>
namespace thing {
class Thing {
public:
Thing ( std::string sName=Thing::sm_sNAME );
virtual Thing *copy ( ) const = 0;
virtual ~Thing ( );
bool operator== ( const Thing& thing ) const;
bool static equal ( const Thing &thing1, const Thing &thing2 );
friend std::ostream& operator<< ( std::ostream& o,const Thing& thing );
virtual Thing* pickout_component ( int id );
virtual Thing* get_component ( int id );
virtual bool insert_component ( Thing *thing );
virtual bool insert_component_at ( Thing *thing, unsigned int pos );
virtual bool remove_component_at ( unsigned int pos );
void select ( );
void unselect ( );
bool is_selected ( ) const;
bool family_selected ( ) const;
const Thing* get_parent ( ) const;
Thing* get_parent ( );
void set_parent ( Thing* newParent );
virtual int size ( ) const;
virtual const Thing* at ( int nIndex ) const;
virtual Thing* at ( int nIndex );
virtual std::vector<Thing*> get_ThingComponents ( );
private:
static unsigned int sm_nNumCreatedThings;
int m_nId;
std::string m_sName;
bool m_bSaved;
bool m_bSelected;
Thing *m_tParent;
void defaultvalues ( );
static const std::string NAME;
static const bool SAVED;
}; // class Thing
}//namespace thing
#endif // #ifndef THING_HEADERFILE041205
#ifndef THING_HEADERFILE041205
#define THING_HEADERFILE041205
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <vector>
namespace thing {
class Thing {
public:
Thing ( std::string sName=Thing::sm_sNAME );
virtual Thing *copy ( ) const = 0;
virtual ~Thing ( );
bool operator== ( const Thing& thing ) const;
bool static equal ( const Thing &thing1, const Thing &thing2 );
friend std::ostream& operator<< ( std::ostream& o,const Thing& thing );
virtual Thing* pickout_component ( int id );
virtual Thing* get_component ( int id );
virtual bool insert_component ( Thing *thing );
virtual bool insert_component_at ( Thing *thing, unsigned int pos );
virtual bool remove_component_at ( unsigned int pos );
void select ( );
void unselect ( );
bool is_selected ( ) const;
bool family_selected ( ) const;
const Thing* get_parent ( ) const;
Thing* get_parent ( );
void set_parent ( Thing* newParent );
virtual int size ( ) const;
virtual const Thing* at ( int nIndex ) const;
virtual Thing* at ( int nIndex );
virtual std::vector<Thing*> get_ThingComponents ( );
private:
static unsigned int sm_nNumCreatedThings;
int m_nId;
std::string m_sName;
bool m_bSaved;
bool m_bSelected;
Thing *m_tParent;
void defaultvalues ( );
static const std::string NAME;
static const bool SAVED;
}; // class Thing
}//namespace thing
#endif // #ifndef THING_HEADERFILE041205
To copy to clipboard, switch view to plain text mode
Header of ContourMesh:
#ifndef CONTOURMESH_HEADERFILE041205
#define CONTOURMESH_HEADERFILE041205
#include <vector>
#include <list>
#include "../Renderable/Renderable.h"
#include "./Contour.h"
#include "./contourmeshlib.h"
#include "../FORTRAN__/fortran.h"
#include <GL/glu.h>
namespace contourmesh{
class ContourMesh: public renderable::Renderable{
public:
ContourMesh ( std::string name=sm_sNAME );
ContourMesh ( Contour *first, Contour *last, std::string name=sm_sNAME );
ContourMesh ( const ContourMesh& contmesh );
ContourMesh *copy ( ) const;
~ContourMesh ( );
void delete_contours ( );
const ContourMesh& operator= ( const ContourMesh& contmesh );
friend std::ostream& operator<< ( std::ostream& o, const ContourMesh& cmesh );
bool operator== ( const ContourMesh& cmesh ) const;
static bool equal ( const ContourMesh& pm1, const ContourMesh& pm2 );
Contour* operator[] ( int i );
const Contour *operator[] ( int i ) const;
static std::vector<ContourMesh*> create_meshes(Contour *firstcontour, Contour *lastcontour);
static std::vector<ContourMesh*> divide_mesh(const ContourMesh *cmesh);
void copy_creation_data_to(std::vector<ContourMesh*> &pr_vCD) const;
void insert_contours(Contour *first, Contour *last);
Contour* get_firstcontour ( );
int num_contours ( ) const;
int num_points ( ) const;
bool& selectable ( );
void draw_shape ( GLfloat pr_fWorldScale=1 );
static unsigned int import_into_oneMesh(std::string filename, ContourMesh &cmesh);
static void export_ContourMesh(ContourMesh &cmesh, std::string filename);
virtual bool
cut ( std::vector<Renderable*> *pr_vInside,
std::vector<Renderable*> *pr_vOutside,
bool pr_bOptimizeEdges, bool pr_bThreeDenvelope,
GLfloat **curve, unsigned int ncurve,
GLfloat pr_fWorldRotationX,
GLfloat pr_fWorldRotationY,
GLfloat pr_fWorldRotationZ,
GLfloat pr_fWorldTranslationX,
GLfloat pr_fWorldTranslationY,
GLfloat pr_fWorldTranslationZ,
GLfloat pr_fWorldScaleX,
GLfloat pr_fWorldScaleY,
GLfloat pr_fWorldScaleZ );
void update_boundingbox ( bool bCenterPivots=false );
protected:
std::vector<Contour*> contours;
private:
const static std::string NAME;
static std::string sm_sNAME;
static unsigned int sm_nNumCreatedContourMeshes;
static bool sm_bClassIsSelectable;
void copyContourMesh ( const ContourMesh &cm );
void insert_contour ( Contour &contour );
static void copy_creation_data ( ContourMesh &to,
const ContourMesh &from );
static void check_along ( Contour *tmpcontour, int *along );
static void check_thickness ( ContourMesh &cmesh,
float *new_val, float old, int along );
}; // class ContourMesh
}// namespace contourmesh
#endif // #ifndef CONTOURMESH_HEADERFILE041205
#ifndef CONTOURMESH_HEADERFILE041205
#define CONTOURMESH_HEADERFILE041205
#include <vector>
#include <list>
#include "../Renderable/Renderable.h"
#include "./Contour.h"
#include "./contourmeshlib.h"
#include "../FORTRAN__/fortran.h"
#include <GL/glu.h>
namespace contourmesh{
class ContourMesh: public renderable::Renderable{
public:
ContourMesh ( std::string name=sm_sNAME );
ContourMesh ( Contour *first, Contour *last, std::string name=sm_sNAME );
ContourMesh ( const ContourMesh& contmesh );
ContourMesh *copy ( ) const;
~ContourMesh ( );
void delete_contours ( );
const ContourMesh& operator= ( const ContourMesh& contmesh );
friend std::ostream& operator<< ( std::ostream& o, const ContourMesh& cmesh );
bool operator== ( const ContourMesh& cmesh ) const;
static bool equal ( const ContourMesh& pm1, const ContourMesh& pm2 );
Contour* operator[] ( int i );
const Contour *operator[] ( int i ) const;
static std::vector<ContourMesh*> create_meshes(Contour *firstcontour, Contour *lastcontour);
static std::vector<ContourMesh*> divide_mesh(const ContourMesh *cmesh);
void copy_creation_data_to(std::vector<ContourMesh*> &pr_vCD) const;
void insert_contours(Contour *first, Contour *last);
Contour* get_firstcontour ( );
int num_contours ( ) const;
int num_points ( ) const;
bool& selectable ( );
void draw_shape ( GLfloat pr_fWorldScale=1 );
static unsigned int import_into_oneMesh(std::string filename, ContourMesh &cmesh);
static void export_ContourMesh(ContourMesh &cmesh, std::string filename);
virtual bool
cut ( std::vector<Renderable*> *pr_vInside,
std::vector<Renderable*> *pr_vOutside,
bool pr_bOptimizeEdges, bool pr_bThreeDenvelope,
GLfloat **curve, unsigned int ncurve,
GLfloat pr_fWorldRotationX,
GLfloat pr_fWorldRotationY,
GLfloat pr_fWorldRotationZ,
GLfloat pr_fWorldTranslationX,
GLfloat pr_fWorldTranslationY,
GLfloat pr_fWorldTranslationZ,
GLfloat pr_fWorldScaleX,
GLfloat pr_fWorldScaleY,
GLfloat pr_fWorldScaleZ );
void update_boundingbox ( bool bCenterPivots=false );
protected:
std::vector<Contour*> contours;
private:
const static std::string NAME;
static std::string sm_sNAME;
static unsigned int sm_nNumCreatedContourMeshes;
static bool sm_bClassIsSelectable;
void copyContourMesh ( const ContourMesh &cm );
void insert_contour ( Contour &contour );
static void copy_creation_data ( ContourMesh &to,
const ContourMesh &from );
static void check_along ( Contour *tmpcontour, int *along );
static void check_thickness ( ContourMesh &cmesh,
float *new_val, float old, int along );
}; // class ContourMesh
}// namespace contourmesh
#endif // #ifndef CONTOURMESH_HEADERFILE041205
To copy to clipboard, switch view to plain text mode
header of PolygonMesh:
#ifndef POLYGONMESH_HEADERFILE021205
#define POLYGONMESH_HEADERFILE021205
#include <stdlib.h>
#include <GL/gl.h>
#include <math.h>
#include <iostream>
#include <list>
#include <vector>
#include <algorithm>
#include "../Renderable/Renderable.h"
#include "./polygonmeshlib.h"
namespace polygonmesh {
class PolygonMesh: public renderable::Renderable {
public:
PolygonMesh ( std::string name = sm_sNAME );
PolygonMesh ( unsigned int *P_arr, GLfloat *V_arr, GLfloat *N_arr,
unsigned int numvert, unsigned int numpol,
std::string name = sm_sNAME );
PolygonMesh ( const PolygonMesh& pmesh );
PolygonMesh *copy ( ) const;
~PolygonMesh ( );
static std::vector<PolygonMesh*> create_meshes ( GLfloat *vertice_array,
GLfloat *normal_array,
unsigned int *polygon_array,
unsigned int numvertices,
unsigned int numpolygons );
static std::vector<PolygonMesh*> divide ( PolygonMesh &bigMesh );
static PolygonMesh* merge ( const std::vector<PolygonMesh*> &meshes );
const PolygonMesh& operator= ( const PolygonMesh& pmesh );
friend std::ostream& operator<< ( std::ostream& o, const PolygonMesh& pmesh );
bool operator== ( const PolygonMesh& pmesh ) const;
static bool equal ( const PolygonMesh& pm1, const PolygonMesh& pm2 );
void draw_shape ( GLfloat pr_fWorldScale=1 );
void copy_creation_data_to ( std::vector<PolygonMesh*> pr_vMD ) const;
GLfloat* get_vertice_array ( );
const GLfloat* get_vertice_array ( ) const;
void set_vertice_array ( GLfloat *newarray );
GLfloat* get_normal_array ( );
const GLfloat* get_normal_array ( ) const;
void set_normal_array ( GLfloat *narr );
bool* get_visible_array ( );
const bool* get_visible_array ( ) const;
void set_visible_array ( bool *varr );
unsigned int* get_polygon_array ( );
const unsigned int* get_polygon_array ( ) const;
void set_polygon_array ( unsigned int *narr );
unsigned int get_number_of_vertices ( ) const;
unsigned int& get_number_of_vertices ( );
unsigned int get_number_of_polygons ( ) const;
unsigned int& get_number_of_polygons ( );
float& get_average ( );
float get_average ( ) const;
float& get_rms ( );
float get_rms ( ) const;
float& get_sigma ( );
float get_sigma ( ) const;
float& get_threshold ( );
float get_threshold ( ) const;
float& get_scale_factor ( );
float get_scale_factor ( ) const;
int& get_sourceid ( );
int get_sourceid ( ) const;
std::string& get_filename ( );
std::string get_filename ( ) const;
bool& selectable ( );
bool selectable ( ) const;
void update_boundingbox ( bool bCenterPivots=false );
protected:
GLfloat *vertice_array;
GLfloat *normal_array;
bool *visible_array;
unsigned int *polygon_array;
unsigned int number_of_vertices;
unsigned int number_of_polygons;
private:
float average;
float rms;
float sigma;
float threshold;
float scale_factor;
int sourceid;
std::string filename;
static bool sm_bClassIsSelectable;
const static std::string NAME;
static std::string sm_sNAME;
static unsigned int sm_nNumCreatedPolygonMeshes;
void copyPolygonMesh ( const PolygonMesh& pmesh );
void zerodefaults ( );
void init_arrays ( int nvertices, int npolygons );
static void copy_creation_data ( PolygonMesh &to, const PolygonMesh &from );
};// class PolygonMesh
}// namespace polygonmesh
#endif //#ifndef POLYGONMESH_HEADERFILE041205
#ifndef POLYGONMESH_HEADERFILE021205
#define POLYGONMESH_HEADERFILE021205
#include <stdlib.h>
#include <GL/gl.h>
#include <math.h>
#include <iostream>
#include <list>
#include <vector>
#include <algorithm>
#include "../Renderable/Renderable.h"
#include "./polygonmeshlib.h"
namespace polygonmesh {
class PolygonMesh: public renderable::Renderable {
public:
PolygonMesh ( std::string name = sm_sNAME );
PolygonMesh ( unsigned int *P_arr, GLfloat *V_arr, GLfloat *N_arr,
unsigned int numvert, unsigned int numpol,
std::string name = sm_sNAME );
PolygonMesh ( const PolygonMesh& pmesh );
PolygonMesh *copy ( ) const;
~PolygonMesh ( );
static std::vector<PolygonMesh*> create_meshes ( GLfloat *vertice_array,
GLfloat *normal_array,
unsigned int *polygon_array,
unsigned int numvertices,
unsigned int numpolygons );
static std::vector<PolygonMesh*> divide ( PolygonMesh &bigMesh );
static PolygonMesh* merge ( const std::vector<PolygonMesh*> &meshes );
const PolygonMesh& operator= ( const PolygonMesh& pmesh );
friend std::ostream& operator<< ( std::ostream& o, const PolygonMesh& pmesh );
bool operator== ( const PolygonMesh& pmesh ) const;
static bool equal ( const PolygonMesh& pm1, const PolygonMesh& pm2 );
void draw_shape ( GLfloat pr_fWorldScale=1 );
void copy_creation_data_to ( std::vector<PolygonMesh*> pr_vMD ) const;
GLfloat* get_vertice_array ( );
const GLfloat* get_vertice_array ( ) const;
void set_vertice_array ( GLfloat *newarray );
GLfloat* get_normal_array ( );
const GLfloat* get_normal_array ( ) const;
void set_normal_array ( GLfloat *narr );
bool* get_visible_array ( );
const bool* get_visible_array ( ) const;
void set_visible_array ( bool *varr );
unsigned int* get_polygon_array ( );
const unsigned int* get_polygon_array ( ) const;
void set_polygon_array ( unsigned int *narr );
unsigned int get_number_of_vertices ( ) const;
unsigned int& get_number_of_vertices ( );
unsigned int get_number_of_polygons ( ) const;
unsigned int& get_number_of_polygons ( );
float& get_average ( );
float get_average ( ) const;
float& get_rms ( );
float get_rms ( ) const;
float& get_sigma ( );
float get_sigma ( ) const;
float& get_threshold ( );
float get_threshold ( ) const;
float& get_scale_factor ( );
float get_scale_factor ( ) const;
int& get_sourceid ( );
int get_sourceid ( ) const;
std::string& get_filename ( );
std::string get_filename ( ) const;
bool& selectable ( );
bool selectable ( ) const;
void update_boundingbox ( bool bCenterPivots=false );
protected:
GLfloat *vertice_array;
GLfloat *normal_array;
bool *visible_array;
unsigned int *polygon_array;
unsigned int number_of_vertices;
unsigned int number_of_polygons;
private:
float average;
float rms;
float sigma;
float threshold;
float scale_factor;
int sourceid;
std::string filename;
static bool sm_bClassIsSelectable;
const static std::string NAME;
static std::string sm_sNAME;
static unsigned int sm_nNumCreatedPolygonMeshes;
void copyPolygonMesh ( const PolygonMesh& pmesh );
void zerodefaults ( );
void init_arrays ( int nvertices, int npolygons );
static void copy_creation_data ( PolygonMesh &to, const PolygonMesh &from );
};// class PolygonMesh
}// namespace polygonmesh
#endif //#ifndef POLYGONMESH_HEADERFILE041205
To copy to clipboard, switch view to plain text mode
Bookmarks