Changeset 6d7651 for molecuilder/src/tesselationhelpers.cpp
- Timestamp:
- Oct 27, 2009, 5:41:12 PM (16 years ago)
- Children:
- dbc152
- Parents:
- 069034
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/tesselationhelpers.cpp
r069034 r6d7651 14 14 #include "verbose.hpp" 15 15 16 double DetGet(gsl_matrix * A,int inPlace) {16 double DetGet(gsl_matrix * const A, const int inPlace) { 17 17 /* 18 18 inPlace = 1 => A is replaced with the LU decomposed copy. … … 42 42 }; 43 43 44 void GetSphere(Vector * center, Vector &a, Vector &b, Vector &c,double RADIUS)44 void GetSphere(Vector * const center, const Vector &a, const Vector &b, const Vector &c, const double RADIUS) 45 45 { 46 46 gsl_matrix *A = gsl_matrix_calloc(3,3); … … 96 96 * @param b vector second point of triangle 97 97 * @param c vector third point of triangle 98 * @param *Umkreismittelpunkt new c neter point of circumference98 * @param *Umkreismittelpunkt new center point of circumference 99 99 * @param Direction vector indicates up/down 100 * @param AlternativeDirection vecotr, needed in case the triangles have 90 deg angle100 * @param AlternativeDirection Vector, needed in case the triangles have 90 deg angle 101 101 * @param Halfplaneindicator double indicates whether Direction is up or down 102 * @param AlternativeIndicator doub e indicates in case of orthogonal triangles which direction of AlternativeDirection is suitable102 * @param AlternativeIndicator double indicates in case of orthogonal triangles which direction of AlternativeDirection is suitable 103 103 * @param alpha double angle at a 104 104 * @param beta double, angle at b … … 107 107 * @param Umkreisradius double radius of circumscribing circle 108 108 */ 109 void GetCenterOfSphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector*AlternativeDirection,110 double HalfplaneIndicator, double AlternativeIndicator, double alpha, double beta, double gamma, double RADIUS,double Umkreisradius)109 void GetCenterOfSphere(Vector* const & Center, const Vector &a, const Vector &b, const Vector &c, Vector * const NewUmkreismittelpunkt, const Vector* const Direction, const Vector* const AlternativeDirection, 110 const double HalfplaneIndicator, const double AlternativeIndicator, const double alpha, const double beta, const double gamma, const double RADIUS, const double Umkreisradius) 111 111 { 112 112 Vector TempNormal, helper; … … 171 171 * \param *c third point 172 172 */ 173 void GetCenterofCircumcircle(Vector * Center, Vector *a, Vector *b, Vector *c)173 void GetCenterofCircumcircle(Vector * const Center, const Vector &a, const Vector &b, const Vector &c) 174 174 { 175 175 Vector helper; … … 177 177 Vector SideA, SideB, SideC; 178 178 SideA.CopyVector(b); 179 SideA.SubtractVector( c);179 SideA.SubtractVector(&c); 180 180 SideB.CopyVector(c); 181 SideB.SubtractVector( a);181 SideB.SubtractVector(&a); 182 182 SideC.CopyVector(a); 183 SideC.SubtractVector( b);183 SideC.SubtractVector(&b); 184 184 alpha = M_PI - SideB.Angle(&SideC); 185 185 beta = M_PI - SideC.Angle(&SideA); … … 215 215 * \return Angle between \a NewSphereCenter and \a OldSphereCenter relative to \a CircleCenter, 2.*M_PI if one test fails 216 216 */ 217 double GetPathLengthonCircumCircle( Vector &CircleCenter, Vector &CirclePlaneNormal, double CircleRadius, Vector &NewSphereCenter, Vector &OldSphereCenter, Vector &NormalVector,Vector &SearchDirection)217 double GetPathLengthonCircumCircle(const Vector &CircleCenter, const Vector &CirclePlaneNormal, const double CircleRadius, const Vector &NewSphereCenter, const Vector &OldSphereCenter, const Vector &NormalVector, const Vector &SearchDirection) 218 218 { 219 219 Vector helper; … … 300 300 * @return true if there is an intersection between the given lines, false otherwise 301 301 */ 302 bool existsIntersection( Vector point1, Vector point2, Vector point3, Vectorpoint4)302 bool existsIntersection(const Vector &point1, const Vector &point2, const Vector &point3, const Vector &point4) 303 303 { 304 304 bool result; … … 403 403 * @return angle between point and reference 404 404 */ 405 double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector)405 double GetAngle(const Vector &point, const Vector &reference, const Vector &OrthogonalVector) 406 406 { 407 407 if (reference.IsZero()) … … 429 429 * \return \f$ \frac{1}{6} \cdot ((a-d) \times (a-c) \cdot (a-b)) \f$ 430 430 */ 431 double CalculateVolumeofGeneralTetraeder( Vector *a, Vector *b, Vector *c, Vector *d)431 double CalculateVolumeofGeneralTetraeder(const Vector &a, const Vector &b, const Vector &c, const Vector &d) 432 432 { 433 433 Vector Point, TetraederVector[3]; … … 438 438 TetraederVector[2].CopyVector(c); 439 439 for (int j=0;j<3;j++) 440 TetraederVector[j].SubtractVector( d);440 TetraederVector[j].SubtractVector(&d); 441 441 Point.CopyVector(&TetraederVector[0]); 442 442 Point.VectorProduct(&TetraederVector[1]); … … 452 452 * \return true - there is such a line (i.e. creation of degenerated triangle is valid), false - no such line (don't create) 453 453 */ 454 bool CheckLineCriteriaForDegeneratedTriangle(const BoundaryPointSet * nodes[3])454 bool CheckLineCriteriaForDegeneratedTriangle(const BoundaryPointSet * const nodes[3]) 455 455 { 456 456 bool result = false; … … 536 536 * @return point which is second closest to the provided one 537 537 */ 538 TesselPoint* FindSecondClosestPoint(const Vector* Point, LinkedCell*LC)538 TesselPoint* FindSecondClosestPoint(const Vector* Point, const LinkedCell* const LC) 539 539 { 540 540 TesselPoint* closestPoint = NULL; … … 649 649 * \return Vector on reference line that has closest distance 650 650 */ 651 Vector * GetClosestPointBetweenLine(ofstream *out, const BoundaryLineSet * Base, const BoundaryLineSet *OtherBase)651 Vector * GetClosestPointBetweenLine(ofstream *out, const BoundaryLineSet * const Base, const BoundaryLineSet * const OtherBase) 652 652 { 653 653 // construct the plane of the two baselines (i.e. take both their directional vectors) … … 689 689 * \return distance between \a *x and plane defined by \a *triangle, -1 - if something went wrong 690 690 */ 691 double DistanceToTrianglePlane(ofstream * out, const Vector *x, const BoundaryTriangleSet *triangle)691 double DistanceToTrianglePlane(ofstream * const out, const Vector *x, const BoundaryTriangleSet * const triangle) 692 692 { 693 693 double distance = 0.; … … 705 705 * \param *mol molecule structure with atom positions 706 706 */ 707 void WriteVrmlFile(ofstream * out, ofstream *vrmlfile, const Tesselation *Tess, const PointCloud *cloud)707 void WriteVrmlFile(ofstream * const out, ofstream * const vrmlfile, const Tesselation * const Tess, const PointCloud * const cloud) 708 708 { 709 709 TesselPoint *Walker = NULL; … … 748 748 * \param *mol molecule structure with atom positions 749 749 */ 750 void IncludeSphereinRaster3D(ofstream * out, ofstream *rasterfile, const Tesselation *Tess, const PointCloud *cloud)750 void IncludeSphereinRaster3D(ofstream * const out, ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud) 751 751 { 752 752 Vector helper; … … 773 773 * \param *mol molecule structure with atom positions 774 774 */ 775 void WriteRaster3dFile(ofstream * out, ofstream *rasterfile, const Tesselation *Tess, const PointCloud *cloud)775 void WriteRaster3dFile(ofstream * const out, ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud) 776 776 { 777 777 TesselPoint *Walker = NULL; … … 818 818 * \param N arbitrary number to differentiate various zones in the tecplot format 819 819 */ 820 void WriteTecplotFile(ofstream * out, ofstream *tecplot, const Tesselation *TesselStruct, const PointCloud *cloud, const int N)820 void WriteTecplotFile(ofstream * const out, ofstream * const tecplot, const Tesselation * const TesselStruct, const PointCloud * const cloud, const int N) 821 821 { 822 822 if ((tecplot != NULL) && (TesselStruct != NULL)) { … … 859 859 * \param *TesselStruct pointer to Tesselation structure 860 860 */ 861 void CalculateConcavityPerBoundaryPoint(ofstream * out, const Tesselation *TesselStruct)861 void CalculateConcavityPerBoundaryPoint(ofstream * const out, const Tesselation * const TesselStruct) 862 862 { 863 863 class BoundaryPointSet *point = NULL; … … 886 886 * \return true - all have exactly two triangles, false - some not, list is printed to screen 887 887 */ 888 bool CheckListOfBaselines(ofstream * out, const Tesselation *TesselStruct)888 bool CheckListOfBaselines(ofstream * const out, const Tesselation * const TesselStruct) 889 889 { 890 890 LineMap::const_iterator testline;
Note:
See TracChangeset
for help on using the changeset viewer.