1 // File: IntPolyh_ArrayOfPoints.cxx
2 // Created: Mon Mar 8 09:32:00 1999
3 // Author: Fabrice SERVANT
4 // <fst@cleox.paris1.matra-dtv.fr>
7 #include <IntPolyh_ArrayOfPoints.ixx>
12 IntPolyh_ArrayOfPoints::IntPolyh_ArrayOfPoints() : n(0),fintp(0),ptr(0) { }
14 IntPolyh_ArrayOfPoints::IntPolyh_ArrayOfPoints(const Standard_Integer N): fintp(0){
18 void IntPolyh_ArrayOfPoints::Init(const Standard_Integer N) {
20 ptr = (void*) (new IntPolyh_Point [N]);
24 Standard_Integer IntPolyh_ArrayOfPoints::GetN() const {
28 Standard_Integer IntPolyh_ArrayOfPoints::NbPoints() const {
32 void IntPolyh_ArrayOfPoints::IncNbPoints() {
36 void IntPolyh_ArrayOfPoints::SetNbPoints(const Standard_Integer endaop) {
44 const IntPolyh_Point& IntPolyh_ArrayOfPoints::Value(const Standard_Integer Index) const {
45 IntPolyh_Point *ptrpoint = (IntPolyh_Point *)ptr;
47 if(Index<0 || Index>=n) {
48 cerr<<" Erreur1 "<<endl;
49 printf("Value() from IntPolyh_ArrayOfPoints : ERROR value outside of the array\n");
52 return(ptrpoint[Index]);
55 IntPolyh_Point& IntPolyh_ArrayOfPoints::ChangeValue(const Standard_Integer Index) {
56 IntPolyh_Point *ptrpoint = (IntPolyh_Point *)ptr;
58 if(Index<0 || Index>=n) {
59 cerr<<" Erreur1 "<<endl;
60 printf("ChangeValue() from IntPolyh_ArrayOfPoints : ERROR value outside of the array\n");
63 return(ptrpoint[Index]);
66 void IntPolyh_ArrayOfPoints::Destroy() {
69 IntPolyh_Point *ptrpoint = (IntPolyh_Point *)ptr;
78 IntPolyh_ArrayOfPoints & IntPolyh_ArrayOfPoints::Copy(const IntPolyh_ArrayOfPoints& Other) {
79 if(ptr==Other.ptr) return(*this);
82 ptr = (void *) (new IntPolyh_Point[n]);
83 for(Standard_Integer i=0;i<=n;i++) {
89 void IntPolyh_ArrayOfPoints::Dump() const{
90 printf("\n ArrayOfPoints 0-> %d\n",fintp-1);
91 printf("size %d, room left%d", n, n-fintp);
92 for(Standard_Integer i=0;i<fintp;i++) {