71 lines
3.1 KiB
C++
71 lines
3.1 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalS
|
|
//----------------------------------------------------------------------------
|
|
// File : GeomDB.h Data : 08.04.13 Versione : 1.1c1
|
|
// Contenuto : Dichiarazione della classe GeomDB.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 22.01.13 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include "GdbObj.h"
|
|
|
|
//----------------------------------------------------------------------------
|
|
typedef std::list< GdbObj*> PGDBO_LIST ;
|
|
typedef std::unordered_map< std::string, GdbObj*> STRPGDBO_UMAP ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class CScan ;
|
|
|
|
//----------------------------------------------------------------------------
|
|
class GeomDB
|
|
{
|
|
public :
|
|
GeomDB( void) ;
|
|
~GeomDB( void) ;
|
|
bool Init( void) ;
|
|
bool Clear( void) ;
|
|
bool Load( std::ifstream& osIn) ;
|
|
bool Save( std::ofstream& osOut) ;
|
|
bool ExistsGdbObj( const std::string& sName) ;
|
|
bool AddVector( const std::string& sName, const Vector3d& Vect) ;
|
|
bool AddPoint( const std::string& sName, const Point3d& Pnt) ;
|
|
bool AddCurveLine( const std::string& sName, const CurveLine& CrvLine) ;
|
|
bool AddCurveArc( const std::string& sName, const CurveArc& CrvArc) ;
|
|
bool AddCurveBez( const std::string& sName, const CurveBezier& CrvBez) ;
|
|
bool AddCurveCompo( const std::string& sName, const CurveComposite& CrvCompo) ;
|
|
GeoObjType GetObjType( const std::string& sName) ;
|
|
const GeoVector3d* GetGeoVector3d( const std::string& sName) ;
|
|
const Vector3d* GetVector( const std::string& sName) ;
|
|
const GeoPoint3d* GetGeoPoint3d( const std::string& sName) ;
|
|
const Point3d* GetPoint( const std::string& sName) ;
|
|
const CurveLine* GetCurveLine( const std::string& sName) ;
|
|
const CurveArc* GetCurveArc( const std::string& sName) ;
|
|
const CurveBezier* GetCurveBez( const std::string& sName) ;
|
|
const CurveComposite* GetCurveCompo( const std::string& sName) ;
|
|
const Curve* GetCurve( const std::string& sName) ;
|
|
bool Copy( const std::string& sNameSou, const std::string& sNameDest) ;
|
|
bool Erase( const std::string& sName) ;
|
|
bool Translate( const std::string& sName, const Vector3d& vtMove) ;
|
|
bool Rotate( const std::string& sName, const Point3d& ptAx, const Vector3d& vtAx, double dAngDeg) ;
|
|
bool Scale( const std::string& sName, const Point3d& ptCen, double dCoeffX, double dCoeffY, double dCoeffZ) ;
|
|
bool Mirror( const std::string& sName, const Point3d& ptOn, const Vector3d& vtNorm) ;
|
|
|
|
private :
|
|
GdbObj* GetGdbObj( const std::string& sName) ;
|
|
bool AddToGeomDB( GdbObj* pGObj) ;
|
|
bool LoadStart( CScan& TheScanner) ;
|
|
bool LoadOneObject( CScan& TheScanner, bool& bEnd) ;
|
|
|
|
private :
|
|
PGDBO_LIST m_GeomDB ; // lista principale, proprietaria degli oggetti
|
|
STRPGDBO_UMAP m_GdbNameMap ; // map basato sui nomi
|
|
} ;
|