Ignore:
Timestamp:
Sep 28, 2009, 8:00:33 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
fca6e7
Parents:
bb56cf
git-author:
Frederik Heber <heber@…> (09/28/09 18:47:54)
git-committer:
Frederik Heber <heber@…> (09/28/09 20:00:33)
Message:

Various fixes and attempt to get convex hull working.

Moved tesselation writing to tesselation.cpp

  • WriteVrmlFile(), WriteRaster3dFile(), WriteTecplotFile() moved to tesselation.cpp
  • these also don't use molecule anymore, but the PointCloud structure (hence, bonds are no more visible)
  • new function TesselStruct::Output() which performs the writing
  • new function InsertSphereInRaster3D(), which places a sphere at the position of the last triangle
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/tesselation.hpp

    rbb56cf r60cbe5  
    3434class PointCloud;
    3535class Tesselation;
     36
     37#define DoTecplotOutput 1
     38#define DoRaster3DOutput 1
     39#define DoVRMLOutput 1
     40#define TecplotSuffix ".dat"
     41#define Raster3DSuffix ".r3d"
     42#define VRMLSUffix ".wrl"
    3643
    3744// ======================================================= some template functions =========================================
     
    115122
    116123    void GetNormalVector(Vector &NormalVector);
     124    void GetCenter(Vector *center);
    117125    bool GetIntersectionInsideTriangle(ofstream *out, Vector *MolCenter, Vector *x, Vector *Intersection);
    118126    bool ContainsBoundaryLine(class BoundaryLineSet *line);
     
    120128    class BoundaryPointSet *GetThirdEndpoint(class BoundaryLineSet *line);
    121129    bool IsPresentTupel(class BoundaryPointSet *Points[3]);
    122     void GetCenter(Vector *center);
     130    bool IsPresentTupel(class BoundaryTriangleSet *T);
    123131
    124132    class BoundaryPointSet *endpoints[3];
     
    200208    void RemoveTesselationPoint(class BoundaryPointSet *point);
    201209
    202     bool IsInside(Vector *pointer);
    203210    class BoundaryPointSet *GetCommonEndpoint(class BoundaryLineSet * line1, class BoundaryLineSet * line2);
    204211
    205212    // concave envelope
    206213    void FindStartingTriangle(ofstream *out, const double RADIUS, class LinkedCell *LC);
    207     void FindSecondPointForTesselation(class TesselPoint* a, class TesselPoint* Candidate, Vector Oben, class TesselPoint*& OptCandidate, double Storage[3], double RADIUS, class LinkedCell *LC);
     214    void FindSecondPointForTesselation(class TesselPoint* a, Vector Oben, class TesselPoint*& OptCandidate, double Storage[3], double RADIUS, class LinkedCell *LC);
    208215    void FindThirdPointForTesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, class LinkedCell *LC);
    209     bool FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, LinkedCell *LC);
     216    bool FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, LinkedCell *LC);
    210217    int CheckPresenceOfTriangle(ofstream *out, class TesselPoint *Candidates[3]);
    211218    class BoundaryTriangleSet * GetPresentTriangle(ofstream *out, TesselPoint *Candidates[3]);
     
    216223    bool InsertStraddlingPoints(ofstream *out, PointCloud *cloud, LinkedCell *LC);
    217224    double RemovePointFromTesselatedSurface(ofstream *out, class BoundaryPointSet *point);
    218     bool FlipBaseline(ofstream *out, class BoundaryLineSet *Base);
    219     bool PickFarthestofTwoBaselines(ofstream *out, class BoundaryLineSet *Base);
     225    class BoundaryLineSet * FlipBaseline(ofstream *out, class BoundaryLineSet *Base);
     226    double PickFarthestofTwoBaselines(ofstream *out, class BoundaryLineSet *Base);
    220227    class BoundaryPointSet *IsConvexRectangle(ofstream *out, class BoundaryLineSet *Base);
    221     map<int, int> FindAllDegeneratedTriangles();
     228    map<int, int> * FindAllDegeneratedTriangles();
     229    map<int, int> * FindAllDegeneratedLines();
    222230    void RemoveDegeneratedTriangles();
     231    void AddBoundaryPointByDegeneratedTriangle(ofstream *out, class TesselPoint *point, LinkedCell *LC);
    223232
    224233    set<TesselPoint*> * GetAllConnectedPoints(ofstream *out, TesselPoint* Point);
     
    239248    void PrintAllBoundaryTriangles(ofstream *out);
    240249
     250    // store envelope in file
     251    void Output(ofstream *out, const char *filename, PointCloud *cloud);
    241252
    242253    PointMap PointsOnBoundary;
     
    261272    class BoundaryLineSet *BLS[3];
    262273    class BoundaryTriangleSet *BTS;
     274    class BoundaryTriangleSet *LastTriangle;
     275    int TriangleFilesWritten;
    263276
    264277  private:
     
    268281};
    269282
    270 bool CheckLineCriteriaForDegeneratedTriangle(class BoundaryPointSet *nodes[3]);
    271 bool SortCandidates(class CandidateForTesselation* candidate1, class CandidateForTesselation* candidate2);
    272 TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC);
    273 TesselPoint* FindSecondClosestPoint(const Vector*, LinkedCell*);
    274 double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector);
    275 Vector * GetClosestPointBetweenLine(ofstream *out, class BoundaryLineSet *Base, class BoundaryLineSet *OtherBase);
    276283
    277284#endif /* TESSELATION_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.