rsvs3D  0.0.0
Codes for the c++ implementation of the 3D RSVS
snakeengine.hpp
Go to the documentation of this file.
1 
7 //===============================================
8 // Include Guards
9 #ifndef SNAKEENGINE_H_INCLUDED
10 #define SNAKEENGINE_H_INCLUDED
11 
12 //===============================================
13 // Levels of debuging Guards
14 #ifdef DEBUGLVL2 // All Debugging calls
15 #define DEBUGLVL1
16 #endif
17 
18 #ifdef DEBUGLVL1 // Debugging of new features.
19 #define TEST_SNAKEENGINE
20 #endif
21 
22 //=================================
23 // forward declared dependencies
24 // class foo; //when you only need a pointer not the actual object
25 // and to avoid circular dependencies
26 
27 //=================================
28 // included dependencies
29 #include <iostream>
30 #include <unordered_map>
31 #include <vector>
32 
33 #include "arraystructures.hpp"
34 #include "postprocessing.hpp"
35 #include "snake.hpp"
36 
37 //==================================
38 // Code
39 // NOTE: function in a class definition are IMPLICITELY INLINED
40 // ie replaced by their code at compile time
41 
42 // Function prototypes
43 void SpawnAtVertex(snake &snakein, int indVert);
44 void SpawnAtVertexVert(snake &newsnake, int nVert, int indVert, int subVert, const std::vector<int> &surfInds,
45  const std::vector<int> &edgeInds, const std::vector<int> &edgeSubs,
46  std::unordered_multimap<int, int> &hashSurfInds);
47 void SpawnAtVertexEdge(snake &newsnake, int nEdge, const std::vector<int> &surfInds, const std::vector<int> &edgeInds,
48  const std::vector<int> &voluInds, const std::vector<int> &surfSubs,
49  std::unordered_multimap<int, int> &hashEdgeInds,
50  std::unordered_multimap<int, int> &hashVoluInds);
51 
52 void SpawnAtVertexSurf3D(snake &newsnake, int nSurf, const std::vector<int> &surfInds, const std::vector<int> &voluInds,
53  const std::vector<int> &voluSubs, std::unordered_multimap<int, int> &hashSurfInds);
54 void SpawnAtVertexSurf2D(snake &newsnake, int nEdge, const std::vector<int> &voluInds);
55 void SpawnAtVertexVolu(snake &newsnake, int nSurf);
56 void MergeAllContactVertices(snake &fullsnake, std::vector<int> &isImpact);
57 
58 void SpawnArrivedSnaxels(snake &fullsnake, const std::vector<int> &isImpact);
59 void SpawnArrivedSnaxelsDir(snake &fullsnake, snake &partSnake, const std::vector<int> &isImpact, int dir,
60  HashedVector<int, int> &vertNoSpawn);
61 
62 //
63 void MergeCleanSnake(snake &fullsnake, std::vector<int> &isImpact);
64 void CleanupSnakeConnec(snake &snakein);
65 void IdentifyMergEdgeSameSurfConnec(const snake &snakein, std::vector<ConnecRemv> &connecEdit);
66 void IndentifyEdgeSameSurf(const snake &snakein, int currSub, int &stepCheck, std::vector<int> &tempSub,
67  std::vector<int> &tempSub2, std::vector<int> &tempSub3, HashedVector<int, int> &tempIndHash,
68  HashedVector<int, int> &edge2Surf, std::vector<int> tempCount);
69 void IdentifyMergEdgeConnec(const snake &snakein, std::vector<ConnecRemv> &connecEdit);
70 void IdentifyMergeEdgeGeneral(const snake &snakein, std::vector<bool> &isObjDone, std::vector<ConnecRemv> &connecEdit,
71  ConnecRemv &tempConnec, ConnecRemv &tempConnec2, std::vector<int> &tempSub,
72  std::vector<int> &tempSub2, std::vector<int> &tempCount,
73  HashedVector<int, int> &tempIndHash);
74 void IdentifyMergeEdgeGeneralChain(const snake &snakein, std::vector<bool> &isObjDone,
75  std::vector<ConnecRemv> &connecEdit, ConnecRemv &tempConnec, ConnecRemv &tempConnec2,
76  std::vector<int> &tempSub, std::vector<int> &tempSub2, std::vector<int> &tempCount,
77  HashedVector<int, int> &tempIndHash, int jjStart);
78 
79 void IdentifyMergSurfConnec(const snake &snakein, std::vector<ConnecRemv> &connecEdit);
80 void IdentifyMergeSurfGeneral(const snake &snakein, std::vector<bool> &isObjDone, std::vector<ConnecRemv> &connecEdit,
81  ConnecRemv &tempConnec, std::vector<int> &tempSub, std::vector<int> &tempSub2,
82  std::vector<int> &tempCount, HashedVector<int, int> &edge2Surf,
83  HashedVector<int, int> &tempIndHash);
84 void IdentifyMergeSurfRecursive(const snake &snakein, std::vector<bool> &isObjDone, std::vector<int> &tempCount,
85  const HashedVector<int, int> &edge2Surf, const HashedVector<int, int> &tempIndHash,
86  ConnecRemv &tempConnec, const std::vector<int> &tempSub,
87  const std::vector<int> &tempSub2, int excludeSub);
88 void ModifyMergVoluConnec(snake &snakein, std::vector<ConnecRemv> &connecEdit, const std::vector<int> &indRmvVert);
89 
90 void ModifyMergSurf2DConnec(snake &snakein, std::vector<ConnecRemv> &connecEdit);
91 void SnaxEdgeConnecDetection(snake &snakein, std::vector<ConnecRemv> &connecEdit);
92 void SnaxNoConnecDetection(const mesh &snakeconn, std::vector<ConnecRemv> &connecEdit);
93 void dispconnrmv(std::vector<ConnecRemv> conn);
94 
95 void CheckSnakeRemovalsVert(const snake &snakein, const std::vector<int> &indRmvVert);
96 void CheckSnakeRemovalsEdge(const snake &snakein, const std::vector<int> &indRmvEdge);
97 void CheckSnakeRemovalsSurf(const snake &snakein, const std::vector<int> &indRmvSurf);
98 void CheckSnakeRemovalsVolu(const snake &snakein, const std::vector<int> &indRmvVolu);
99 // Test Function prototypes
100 #endif // SNAKSTRUCT_H_INCLUDED
Provide std::vector container with hashed index mapping.
Class containing the information needed to trim objects from a mesh.
Definition: mesh.hpp:514
Class for mesh handling.
Definition: mesh.hpp:592
Definition: snake.hpp:83
Provide tecplot file formating for mesh and snake outputs.
Provides the core restricted surface snake container.