diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/CurvedElement.cc (renamed from src/main/Curved.cc) | 6 | ||||
-rw-r--r-- | src/main/CurvedElement.h (renamed from src/main/Curved.h) | 12 | ||||
-rw-r--r-- | src/main/Element.h | 3 | ||||
-rw-r--r-- | src/main/Makefile | 2 | ||||
-rw-r--r-- | src/main/StraightElement.cc (renamed from src/main/Straight.cc) | 4 | ||||
-rw-r--r-- | src/main/StraightElement.h (renamed from src/main/Straight.h) | 12 |
6 files changed, 20 insertions, 19 deletions
diff --git a/src/main/Curved.cc b/src/main/CurvedElement.cc index f96ad6e..188d042 100644 --- a/src/main/Curved.cc +++ b/src/main/CurvedElement.cc @@ -1,16 +1,16 @@ /* - * Curved.cc + * CurvedElement.cc * * Created on: Mar 22, 2011 * Author: jakob */ #include <math.h> -#include "Curved.h" +#include "CurvedElement.h" namespace vhc { -Curved::Curved(const Vector3D& entry, const Vector3D& exit, double sectionRadius, double curvature, Element* next): +CurvedElement::CurvedElement(const Vector3D& entry, const Vector3D& exit, double sectionRadius, double curvature, Element* next): Element(entry, exit, sectionRadius, next), curvature(curvature), curvatureCenter(Vector3D::Null){} /*{ diff --git a/src/main/Curved.h b/src/main/CurvedElement.h index 8944864..88f33b6 100644 --- a/src/main/Curved.h +++ b/src/main/CurvedElement.h @@ -1,12 +1,12 @@ /* - * Curved.h + * CurvedElement.h * * Created on: Mar 22, 2011 * Author: jakob */ -#ifndef CURVED_H_ -#define CURVED_H_ +#ifndef CURVEDELEMENT_H_ +#define CURVEDELEMENT_H_ #include <math.h> //#include <cmath.h> @@ -17,7 +17,7 @@ namespace vhc { //TODO implement abstract methods of Element -class Curved: public Element { +class CurvedElement: public Element { protected: @@ -26,7 +26,7 @@ protected: public: - Curved(const Vector3D& entry, const Vector3D& exit, double sectionRadius, double curvature, Element* next = NULL); + CurvedElement(const Vector3D& entry, const Vector3D& exit, double sectionRadius, double curvature, Element* next = NULL); virtual bool isOutside(const Particle& particle) const { Vector3D x(particle.getPosition() - entryPosition); @@ -42,4 +42,4 @@ public: } -#endif /* CURVED_H_ */ +#endif /* CURVEDELEMENT_H_ */ diff --git a/src/main/Element.h b/src/main/Element.h index 9dfd12f..2dec462 100644 --- a/src/main/Element.h +++ b/src/main/Element.h @@ -17,6 +17,7 @@ namespace vhc { class Element { private: + /** Empêche la copie d'éléments et facilite ainsi la gestion de pointeurs. * Pourquoi aurait-on besoin de copier un élément? */ Element(const Element& e); @@ -85,7 +86,7 @@ public: /** Assigne un pointeur sur l'element suivant. */ //TODO use pointer? - void setNext(Element& n) {next = &n;} + void setNext(Element* n) {next = n;} }; diff --git a/src/main/Makefile b/src/main/Makefile index f488218..e9355bc 100644 --- a/src/main/Makefile +++ b/src/main/Makefile @@ -13,7 +13,7 @@ LOCALDIR = main # ==> Ajouter ici les objets à compiler # Si un objet nécessite une compilation non-standard (i.e. pas de règle du style Foo.o : Foo.cc Foo.h), rajouter # cette règle. -LOCALOBJS = Vector3D.o Particle.o Printable.o Element.o Curved.o Straight.o +LOCALOBJS = Vector3D.o Particle.o Printable.o Element.o CurvedElement.o StraightElement.o OBJS=$(addprefix $(BINDIR)/$(LOCALDIR)/,$(LOCALOBJS)) .PHONY = lib diff --git a/src/main/Straight.cc b/src/main/StraightElement.cc index 3a36c06..d1540ec 100644 --- a/src/main/Straight.cc +++ b/src/main/StraightElement.cc @@ -1,11 +1,11 @@ /* - * Straight.cc + * StraightElement.cc * * Created on: Mar 22, 2011 * Author: jakob */ -#include "Straight.h" +#include "StraightElement.h" namespace vhc { diff --git a/src/main/Straight.h b/src/main/StraightElement.h index a842b2f..5a1d944 100644 --- a/src/main/Straight.h +++ b/src/main/StraightElement.h @@ -1,12 +1,12 @@ /* - * Straight.h + * StraightElement.h * * Created on: Mar 22, 2011 * Author: jakob */ -#ifndef STRAIGHT_H_ -#define STRAIGHT_H_ +#ifndef STRAIGHTELEMENT_H_ +#define STRAIGHTELEMENT_H_ #include "Vector3D.h" #include "Element.h" @@ -15,11 +15,11 @@ namespace vhc { -class Straight: public Element { +class StraightElement: public Element { public: - Straight(const Vector3D& entry, const Vector3D& exit, double sectionRadius, Element* next = NULL): + StraightElement(const Vector3D& entry, const Vector3D& exit, double sectionRadius, Element* next = NULL): Element(entry, exit, sectionRadius, next) {}; @@ -39,4 +39,4 @@ public: } -#endif /* STRAIGHT_H_ */ +#endif /* STRAIGHTELEMENT_H_ */ |