Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYPolyligneParcours.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
16 /*
17  *
18  *
19  *
20  *
21  */
22 
23 #ifndef TYPOLYLIGNE_PARCOURS
24  #define TYPOLYLIGNE_PARCOURS
25 
26  #include "TYPointParcours.h"
27  #include <iostream>
28 
33 {
34  int _nNbPoint;
37 
38 public:
41 
46 
47  int indexePoint(int i);
48  int indexePremierPoint();
49  int indexeDernierPoint();
51  {
52  return indexePoint(0);
53  }
55  {
56  return indexePoint(1);
57  }
58 
60  {
61  return _nNbPoint;
62  }
63  void setPoint(int indexe, TYPointParcours* p);
64  void ajoutePoint(int indexe, TYPointParcours* p);
65  TYPointParcours point(int indexe)
66  {
67  return *_PtrPoints[indexe];
68  }
70  {
71  return _PtrPoints[indexe];
72  }
73 
74  bool isInfra();
75  bool isEcran();
76 
79 
82 
89  int indexePointSuivant(int IndexPoint, TYPolyligneParcours*& PolyligneSuivante);
91  TYPolyligneParcours* polyligneSuivante(int IndexPoint);
93  int autrePointDuSegment(int IndexPoint);
94 
96  bool estSurUnParcourFermee();
98  bool estFermee();
100  bool allouer(int nNbPoint);
102  void desallouer();
104  void Copy(TYPolyligneParcours& p);
105 
107  {
108  return _nNbPointAlloue;
109  }
110 
117  bool extendPtrPoints(int nNouvelleTaille);
118 
119 private:
121 };
122 
123 #endif
124 // TYPOLYLIGNE_PARCOURS
Polylines path class used by the TYSetGeometriqueParcours class.
void ajoutePoint(int indexe, TYPointParcours *p)
Add a point.
TYPointParcours ** _PtrPoints
Array of pointers to points.
int indexePremierPoint()
Return point id of first point of the polyline.
TYPointParcours point(int indexe)
Return a copy the point Pi.
int _nNbPoint
Number of points on the polyline.
TYPolyligneParcours * _PolyligneP1
Pointer to the next polyline (from P1 point)
bool allouer(int nNbPoint)
Allocate nNbPoint points to the polyline.
void desallouer()
Delete list of points of the polyline.
void ajouteSegment(TYPointParcours *p1, TYPointParcours *p2)
Add a first polyline with two points p1 and p2.
int indexePoint2()
Return point id of point P1.
bool extendPtrPoints(int nNouvelleTaille)
Extends the attribute array _PtrPoints.
bool estSurUnParcourFermee()
Return true if the polyline belongs to a closed path.
bool polylignesVoisinesPointentSurLaMemePolyligne()
Return true if _PolyligneP0 and _PolyligneP1 exist and are the same.
int indexePoint1()
Return point id of point P0.
int indexeDernierPoint()
Return point id of last point of the polyline.
void setPoint(int indexe, TYPointParcours *p)
Change a point.
int indexePointSuivant(int IndexPoint, TYPolyligneParcours *&PolyligneSuivante)
Return the point id of the next point given by IndexPoint id.
bool estFermee()
Return true if the polyline is closed.
int nombreDePoint()
Return the number of points.
TYPointParcours * pointPtr(int indexe)
Return a pointer on the point Pi.
int autrePointDuSegment(int IndexPoint)
Return P0 if IndexPoint is the point id of P1, else P1 if it is the id of P0, else -1.
bool isEcran()
Return true if P0 and P1 are Ecran.
~TYPolyligneParcours()
Destructor.
TYPolyligneParcours * polyligneSuivante(int IndexPoint)
Return the next polyline pointed by the Point id IndexPoint.
TYPolyligneParcours * _PolyligneP0
Pointer to the previous polyline (from P0 point)
bool isInfra()
Return true if P0 and P1 are Infra.
void Copy(TYPolyligneParcours &p)
Copy operator.
TYPolyligneParcours()
Default constructor.
int indexePoint(int i)
Return point id of point i of the polyline.
int _nNbPointAlloue
Number of allocated points on the polyline.
Point of a path.