1 #include "LineElement.h" 20 std::vector<std::vector<int>>
cycles;
21 std::vector<std::vector<int>>
graph;
23 typedef std::pair<int, int>
Edge;
24 std::vector<std::vector<Edge>>
edges;
122 bool equals(std::vector<int> a, std::vector<int> b);
130 bool isNew(std::vector<int> path);
139 bool visited(
int n, std::vector<int> path);
162 std::vector<LineElement*>
getOpenElements(std::vector<LineElement*> elements);
172 std::vector<int>
invert(std::vector<int> path);
180 std::vector<int>
normalize(std::vector<int> path);
std::pair< int, int > Edge
Defining an Edge to consist of to vertices (start and end) in the format of int's.
Definition: CycleDetection.h:23
Performs cycle detection on the cross section, used for determination of cells during thin-wall analy...
Definition: CycleDetection.h:7
void calculateCellArea()
Calculates the area of each cell.
Definition: CycleDetection.cpp:288
void printEdgeCycles(std::vector< std::vector< Edge >> edges)
Prints cycles and their edges.
Definition: CycleDetection.cpp:23
std::vector< std::vector< int > > cycles
Vector containing cycles in vertex form.
Definition: CycleDetection.h:20
void sortCycles()
Sorts cycles vector from largest cycles to the smallest cycles.
Definition: CycleDetection.cpp:189
std::vector< std::vector< int > > graph
Graph that is created from vertices and edges.
Definition: CycleDetection.h:21
bool visited(int n, std::vector< int > path)
Checks if node n is part of the path.
Definition: CycleDetection.cpp:175
bool isNew(std::vector< int > path)
Determines if a cycle is not discovered.
Definition: CycleDetection.cpp:161
std::vector< LineElement * > getOpenElements(std::vector< LineElement * > elements)
Gets all open elements.
Definition: CycleDetection.cpp:277
void findAllCycles()
Finds all cells in a cross-section without duplicates. Calls findNewCycle() from all the nodes in the...
Definition: CycleDetection.cpp:47
void findNewCycles(std::vector< int > path)
Finds new cells not previously found, and stores them as a vector of nodes.
Definition: CycleDetection.cpp:59
int findSmallestElement(std::vector< int > path)
Finds the smallest element in path.
Definition: CycleDetection.cpp:148
void convertEdgesToElements(std::vector< LineElement * > elements)
Converts the edges in cycles, to their corresponding elements.
Definition: CycleDetection.cpp:229
void convertCyclesToEdges()
Converts the cycles from storing nodes, to storing edges.
Definition: CycleDetection.cpp:256
std::vector< double > cycleArea
Vector containing the areas of all the cycles not containing other cycles.
Definition: CycleDetection.h:25
CycleDetection(std::vector< LineElement * > elements)
Constructor.
Definition: CycleDetection.cpp:4
void reverseCycle(int i)
Reverses the cycle.
Definition: CycleDetection.cpp:342
bool equals(std::vector< int > a, std::vector< int > b)
Determines if two vectors are equal, i.e contains the same nodes in the same order.
Definition: CycleDetection.cpp:101
std::vector< std::vector< Edge > > edges
Vector containing edges.
Definition: CycleDetection.h:24
std::vector< int > normalize(std::vector< int > path)
Rotates path so the smallest node is listed first.
Definition: CycleDetection.cpp:132
std::vector< std::vector< LineElement * > > elementCycles
Vector containing only the line elements that are a part of a cell (sub-cycle)
Definition: CycleDetection.h:22
void constructGraph(std::vector< LineElement * > element)
Creates graph from the elements provided.
Definition: CycleDetection.cpp:37
void removeSuperCycles()
Removes all cycles containing other (smaller) cycles.
Definition: CycleDetection.cpp:193
std::vector< std::vector< LineElement * > > getAllCycles()
Gets all cells that have been detected.
Definition: CycleDetection.cpp:273
std::vector< int > invert(std::vector< int > path)
Inverts a path.
Definition: CycleDetection.cpp:119
void printCells()
Prints all the cells found.
Definition: CycleDetection.cpp:350