ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/geometrie/src/occ_point.cpp
Revision: 906
Committed: Mon Nov 13 22:30:18 2017 UTC (7 years, 6 months ago) by couturad
File size: 3835 byte(s)
Log Message:
Nouveau opencascade commit 1

File Contents

# User Rev Content
1 francois 283 //---------------------------------------------------------------------------
2     //------------------------------------------------------------
3     //------------------------------------------------------------
4     // MAGiC
5     // Jean Christophe Cuilli�re et Vincent FRANCOIS
6     // D�partement de G�nie M�canique - UQTR
7     //------------------------------------------------------------
8     // Le projet MAGIC est un projet de recherche du d�partement
9     // de g�nie m�canique de l'Universit� du Qu�bec �
10     // Trois Rivi�res
11     // Les librairies ne peuvent �tre utilis�es sans l'accord
12     // des auteurs (contact : francois@uqtr.ca)
13     //------------------------------------------------------------
14     //------------------------------------------------------------
15     //
16     // occ_point.cpp
17     //
18     //------------------------------------------------------------
19     //------------------------------------------------------------
20     // COPYRIGHT 2000
21     // Version du 02/03/2006 � 11H22
22     //------------------------------------------------------------
23     //------------------------------------------------------------
24     //---------------------------------------------------------------------------
25     #pragma hdrstop
26     #include "gestionversion.h"
27     #ifdef BREP_OCC
28    
29     #include "occ_point.h"
30 couturad 906 #include "occ_fonction_v2017.h"
31 francois 283 #include "constantegeo.h"
32    
33     //---------------------------------------------------------------------------
34     #pragma package(smart_init)
35 couturad 906 OCC_POINT::OCC_POINT(unsigned long num,TopoDS_Vertex pt, class OCC_FONCTION* fonc):MG_POINT(num),point(pt), fonction1(fonc)
36 francois 283 {
37     }
38 couturad 906 OCC_POINT::OCC_POINT(TopoDS_Vertex pt, class OCC_FONCTION* fonc):MG_POINT(),point(pt), fonction1(fonc)
39 francois 283 {
40     }
41 couturad 906 OCC_POINT::OCC_POINT(TopoDS_Vertex pt) :MG_POINT(),point(pt)
42     {
43     }
44 francois 283 OCC_POINT::OCC_POINT(OCC_POINT& mdd):MG_POINT(mdd),point(mdd.point),fonction1(mdd.fonction1)
45     {
46     }
47 couturad 906
48 francois 283 OCC_POINT::~OCC_POINT()
49     {
50     }
51     void OCC_POINT::evaluer(double *xyz)
52     {
53     gp_Pnt p=BRep_Tool::Pnt(point);
54     p.Coord(xyz[0], xyz[1], xyz[2]);
55    
56     }
57    
58 francois 763 void OCC_POINT::enregistrer(std::ostream& o,double version)
59 francois 283 {
60 couturad 906 if(fonction1->get_version()=="OCCV2017")
61     {
62     OCC_FONCTION_V2017* occ_fonction_v2017 = (OCC_FONCTION_V2017*)fonction1;
63     MG_ELEMENT_TOPOLOGIQUE* sommet = occ_fonction_v2017->get_MG_ELEMENT_TOPOLOGIQUE(point);
64     o << "%"<<get_id()<<"=POINT_OCC("<< sommet->get_id()<<");" << std::endl;
65     }
66     else
67     {
68     o << "%"<<get_id()<<"=POINT_OCC("<<fonction1->GetID(point)<< ");" << std::endl;
69     }
70 francois 283 }
71    
72     int OCC_POINT::get_type_geometrique(TPL_LISTE_ENTITE<double> &param)
73     {
74     gp_Pnt p=BRep_Tool::Pnt(point);
75 couturad 906 // Handle(Geom_CartesianPoint) coppoint=new Geom_CartesianPoint(p);
76     // Handle_Standard_Type type=coppoint->DynamicType();
77 francois 283
78 couturad 906 // if (type==STANDARD_TYPE(Geom_CartesianPoint))
79     // {
80     // Handle_Geom_CartesianPoint P=Handle_Geom_CartesianPoint::DownCast(coppoint);
81 francois 283
82     double xyz[3];
83     param.ajouter(xyz[0]=p.X());
84     param.ajouter(xyz[1]=p.Y());
85     param.ajouter(xyz[2]=p.Z());
86 couturad 906 // }
87 francois 283
88     return MGCo_POINT;
89     }
90     void OCC_POINT::get_param_NURBS(int& indx_premier_ptctr,TPL_LISTE_ENTITE<double> &param)
91     {
92     gp_Pnt p=BRep_Tool::Pnt(point);
93    
94     // the first parameter indicates the acces code
95     param.ajouter(0);
96     // the second parameter indicates the order of the point which should be one for a point
97     param.ajouter(1);
98     param.ajouter(0);
99    
100     param.ajouter(1);
101     param.ajouter(0);
102    
103     // the third parameter presente the number of the controls point wich correspond to the cordinate point
104     // note that the cordinate of the control points are given in homogeneous cordinates
105     // for a point, the weight it's �qual to one.
106    
107     param.ajouter(p.X());
108     param.ajouter(p.Y());
109     param.ajouter(p.Z());
110    
111     param.ajouter(1.);
112    
113     indx_premier_ptctr =5;
114    
115    
116     }
117 couturad 906
118     void OCC_POINT::change_occ_fonction(OCC_FONCTION* fonction)
119     {
120     fonction1=fonction;
121     }
122    
123 francois 283 #endif
124    
125