Public Member Functions | |
void | addTrianglesToRegion (final List< Triangle > newTr) |
void | addTriangleToRegion (final Triangle newTr) |
void | addTriangleToRegionBoundary (final Triangle newTr) |
void | buildUpRegion () |
Appearance | getAppearance () |
float | getAreaOfRegion () |
List< Edge > | getBoundaryEdges () |
List< Triangle > | getBoundaryTriangles () |
Edge | getCommonEdge (Triangle triangle) |
List< Edge > | getCommonEdges (Region neighbor) |
float[] | getCurvatureMinMaxOfRegion () |
List< Region > | getNeighbors () |
List< Triangle > | getOutsideBoundaryUnlabelled () |
float | getPerimeterOfRegion () |
int | getRegionId () |
List< Triangle > | getTriangles () |
void | initializeApperance () |
boolean | isNeighbor (Region region) |
Region (final int newId) | |
Region (final int newId, final Triangle initSeedTr) | |
void | removeTriangleFromRegion (final Triangle toRemove) |
void | setApperance (final Appearance newAppearance) |
void | setCurvatureMax (final float kMax) |
void | setCurvatureMin (final float kMin) |
void | setCurvatureMinMax (final float kMinkMax) |
String | toString () |
void | updateAreaOfRegion () |
void | updatePerimeterOfRegion () |
void | updateRegionBoundary () |
void | updateRegionNeighbors (List< Region > allRegions) |
Private Member Functions | |
void | updateAreaOfRegion (final Triangle tr, final boolean toRemove) |
Private Attributes | |
Appearance | appearance = new Appearance() |
float | area |
final List< Triangle > | boundaryTriangles = new ArrayList<Triangle>() |
final float[] | curvatureMinMax = new float[3] |
final List< Edge > | edgeBoundary = new ArrayList<Edge>() |
final int | id |
float | perimeter |
final List< Region > | regionNeighbors = new ArrayList<Region>() |
final List< Triangle > | triangles = new ArrayList<Triangle>() |
Class that implements the data storage and functionality of a region as a connected area of triangles on the mesh surface that share common curvature properties. These triangles are situated on relatively contained and localized position on the mesh which are thus implemented as regions.
Definition at line 23 of file Region.java.
edu.tum.cs.vis.model.util.Region.Region | ( | final int | newId | ) | [inline] |
Constructor for a region that takes only the region id
newId | region id |
Definition at line 81 of file Region.java.
edu.tum.cs.vis.model.util.Region.Region | ( | final int | newId, |
final Triangle | initSeedTr | ||
) | [inline] |
Constructor for a region that takes the region id and the initial seed triangle from which the region build-up starts
newId | region id |
initSeedTr | seed triangle from which region growing starts |
Definition at line 98 of file Region.java.
void edu.tum.cs.vis.model.util.Region.addTrianglesToRegion | ( | final List< Triangle > | newTr | ) | [inline] |
Adds a list of triangles to the list of triangles in the region. If a triangle was already in the region, it is skipped.
newTr | list of traingles to be added to the region |
Definition at line 366 of file Region.java.
void edu.tum.cs.vis.model.util.Region.addTriangleToRegion | ( | final Triangle | newTr | ) | [inline] |
Adds triangle to the list of triangles included in the region. The addition is performed only if the triangle was not previously inside the region. If the triangle was already in the region, this function does nothing.
newTr | triangle to be checked and added to triangle |
Definition at line 390 of file Region.java.
void edu.tum.cs.vis.model.util.Region.addTriangleToRegionBoundary | ( | final Triangle | newTr | ) | [inline] |
Checks if a triangle is at a region's boundary and if it is it adds it to the list and then removes any triangles from the list that are not longer at the boundary. If the triangle is not at the boundary, this function does nothing. The check is based on the neighbors of the triangle compared against the triangles already in the region.
newTr | triangle to be checked and added to region boundary |
Definition at line 409 of file Region.java.
void edu.tum.cs.vis.model.util.Region.buildUpRegion | ( | ) | [inline] |
Builds the region starting from the initial triangle seed used to initialize the region. The growing algorithm makes sure to classify triangles with the same curvature properties in the same region without stepping over the edges identified as sharp edges. Thus the growing process is based on the neighboring relations among triangles and on their curvature information. Consequently, connected triangles on the mesh that share same curvature properties and are not separated by a sharp edge are brought together starting from the seed triangle of the region.
The region growing algorithm is based on the paper "A new CAD mesh segmentation method, based on curvature tensor analysis", Guillaume Lavoue, Florent Dupont, Atilla Baskurt, Computer-Aided Design 37 (2005), 975–987.
Definition at line 538 of file Region.java.
Appearance edu.tum.cs.vis.model.util.Region.getAppearance | ( | ) | [inline] |
float edu.tum.cs.vis.model.util.Region.getAreaOfRegion | ( | ) | [inline] |
List<Edge> edu.tum.cs.vis.model.util.Region.getBoundaryEdges | ( | ) | [inline] |
Gets the region's list of boundary edges
Definition at line 177 of file Region.java.
List<Triangle> edu.tum.cs.vis.model.util.Region.getBoundaryTriangles | ( | ) | [inline] |
Gets the region's list of boundary triangles
Definition at line 159 of file Region.java.
Edge edu.tum.cs.vis.model.util.Region.getCommonEdge | ( | Triangle | triangle | ) | [inline] |
Determines the common edge a triangle from outside or inside the region (not from the boundary) has with the region boundary
triangle | to be checked |
Definition at line 238 of file Region.java.
List<Edge> edu.tum.cs.vis.model.util.Region.getCommonEdges | ( | Region | neighbor | ) | [inline] |
Detects the shared edges at the boundary of two regions
neighbor | region to be checked |
Definition at line 217 of file Region.java.
float [] edu.tum.cs.vis.model.util.Region.getCurvatureMinMaxOfRegion | ( | ) | [inline] |
Gets the curvature values associated with the region as an array containing the kMin, kMax, kMinMax
curvature values
Definition at line 187 of file Region.java.
List<Region> edu.tum.cs.vis.model.util.Region.getNeighbors | ( | ) | [inline] |
Gets the region's list of region neighbors
Definition at line 168 of file Region.java.
List<Triangle> edu.tum.cs.vis.model.util.Region.getOutsideBoundaryUnlabelled | ( | ) | [inline] |
Determines the triangle neighbors of the region that are still not labelled as belonging to a region
Definition at line 197 of file Region.java.
float edu.tum.cs.vis.model.util.Region.getPerimeterOfRegion | ( | ) | [inline] |
int edu.tum.cs.vis.model.util.Region.getRegionId | ( | ) | [inline] |
List<Triangle> edu.tum.cs.vis.model.util.Region.getTriangles | ( | ) | [inline] |
void edu.tum.cs.vis.model.util.Region.initializeApperance | ( | ) | [inline] |
Initializes the appearance of a newly created region by randomizing the fill color associated with the region.
Definition at line 310 of file Region.java.
boolean edu.tum.cs.vis.model.util.Region.isNeighbor | ( | Region | region | ) | [inline] |
Returns a boolean specifying whether the region passed as an argument is a neighbor or not of the current instance
region | region to be checked |
Definition at line 299 of file Region.java.
void edu.tum.cs.vis.model.util.Region.removeTriangleFromRegion | ( | final Triangle | toRemove | ) | [inline] |
Removes triangle from region and updates the list of region triangles and of the region boundary triangles
Definition at line 449 of file Region.java.
void edu.tum.cs.vis.model.util.Region.setApperance | ( | final Appearance | newAppearance | ) | [inline] |
Sets the region's appearance
newAppearance | to be set |
Definition at line 257 of file Region.java.
void edu.tum.cs.vis.model.util.Region.setCurvatureMax | ( | final float | kMax | ) | [inline] |
Sets the region's maximum curvature kMax
value
kMax | curvature to be set |
Definition at line 277 of file Region.java.
void edu.tum.cs.vis.model.util.Region.setCurvatureMin | ( | final float | kMin | ) | [inline] |
Sets the region's minimum curvature kMin
value
kMin | curvature to be set |
Definition at line 267 of file Region.java.
void edu.tum.cs.vis.model.util.Region.setCurvatureMinMax | ( | final float | kMinkMax | ) | [inline] |
Sets the region's min-max curvature kMinkMax
value
kMinkMax | curvature to be set |
Definition at line 287 of file Region.java.
String edu.tum.cs.vis.model.util.Region.toString | ( | ) | [inline] |
Definition at line 575 of file Region.java.
void edu.tum.cs.vis.model.util.Region.updateAreaOfRegion | ( | ) | [inline] |
Calculates in-place the region surface area based on the individual areas of the triangles which are part of the region
Definition at line 323 of file Region.java.
void edu.tum.cs.vis.model.util.Region.updateAreaOfRegion | ( | final Triangle | tr, |
final boolean | toRemove | ||
) | [inline, private] |
Adds up or subtracts in-place the area of a specified triangle to the area of the region. If the toRemove
flag is raised the area is subtracted, otherwise it is added.
tr | triangle whose area needs to be added / subtracted to region |
toRemove | flag to subtract the area from |
Definition at line 339 of file Region.java.
void edu.tum.cs.vis.model.util.Region.updatePerimeterOfRegion | ( | ) | [inline] |
Calculates in-place the perimeter of the region using the boundary edges.
Definition at line 352 of file Region.java.
void edu.tum.cs.vis.model.util.Region.updateRegionBoundary | ( | ) | [inline] |
Updates the boundary region based on the existing triangles inside the region itself
Definition at line 465 of file Region.java.
void edu.tum.cs.vis.model.util.Region.updateRegionNeighbors | ( | List< Region > | allRegions | ) | [inline] |
Updates the region neighbors based on a list containing a list of regions
allRegions | list of regions to be checked (ideally it should contain all the regions on the mesh of the CAD model) |
Definition at line 491 of file Region.java.
Appearance edu.tum.cs.vis.model.util.Region.appearance = new Appearance() [private] |
The appearance associated with the region. This is used to customize the view of the triangles that are part of the region
Definition at line 73 of file Region.java.
float edu.tum.cs.vis.model.util.Region.area [private] |
The area of the entire region
Definition at line 33 of file Region.java.
final List<Triangle> edu.tum.cs.vis.model.util.Region.boundaryTriangles = new ArrayList<Triangle>() [private] |
A list of all the triangles on the boundary of the region
Definition at line 52 of file Region.java.
final float [] edu.tum.cs.vis.model.util.Region.curvatureMinMax = new float[3] [private] |
The curvature parameters of the boundary. The first parameter stores the minimum value of the curvature kMin
, the second one the maximum value of the curvature kMax
and the third the MinMax kMinMax
curvature value as they were computed by the calculateCurvatures(HashMap<Vertex, Curvature>, Model)
routine from the knowrob_mesh_reasoning add-on
Definition at line 42 of file Region.java.
final List<Edge> edu.tum.cs.vis.model.util.Region.edgeBoundary = new ArrayList<Edge>() [private] |
A list of all edges at the boundary that form in the end the perimeter of the region
Definition at line 62 of file Region.java.
final int edu.tum.cs.vis.model.util.Region.id [private] |
Stores the regions label id
Definition at line 28 of file Region.java.
float edu.tum.cs.vis.model.util.Region.perimeter [private] |
The flaoting point value of the region's perimeter
Definition at line 67 of file Region.java.
final List<Region> edu.tum.cs.vis.model.util.Region.regionNeighbors = new ArrayList<Region>() [private] |
A list of all the regions that are neighbors of this region instance
Definition at line 57 of file Region.java.
final List<Triangle> edu.tum.cs.vis.model.util.Region.triangles = new ArrayList<Triangle>() [private] |
A list of all the triangles inside the region
Definition at line 47 of file Region.java.