Commit 724da3e7 authored by Mike Kremer's avatar Mike Kremer

Added conversion functions for all types of features (vertices, edges and faces).

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12742 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 4dcafc23
...@@ -408,6 +408,46 @@ void convertVertexToFaceSelection(MeshT* _mesh) { ...@@ -408,6 +408,46 @@ void convertVertexToFaceSelection(MeshT* _mesh) {
} }
} }
template< typename MeshT >
inline
void convertVertexSelectionToFeatureVertices(MeshT* _mesh) {
for (typename MeshT::VertexIter v_it = _mesh->vertices_begin(); v_it != _mesh->vertices_end(); ++v_it) {
if (_mesh->status(v_it).selected()) {
_mesh->status(v_it).set_feature(true);
} else {
_mesh->status(v_it).set_feature(false);
}
}
}
template< typename MeshT >
inline
void convertFeatureVerticesToVertexSelection(MeshT* _mesh) {
for (typename MeshT::VertexIter v_it = _mesh->vertices_begin(); v_it != _mesh->vertices_end(); ++v_it) {
if (_mesh->status(v_it).feature()) {
_mesh->status(v_it).set_selected(true);
} else {
_mesh->status(v_it).set_selected(false);
}
}
}
template< typename MeshT >
inline
void clearFeatureVertices(MeshT* _mesh) {
for (typename MeshT::VertexIter v_it = _mesh->vertices_begin(); v_it != _mesh->vertices_end(); ++v_it) {
_mesh->status(v_it).set_feature(false);
}
}
//========================================================= //=========================================================
//== Modeling Regions ===================================== //== Modeling Regions =====================================
//========================================================= //=========================================================
...@@ -681,7 +721,7 @@ void convertEdgeToHalfedgeSelection(MeshT* _mesh) { ...@@ -681,7 +721,7 @@ void convertEdgeToHalfedgeSelection(MeshT* _mesh) {
template< typename MeshT > template< typename MeshT >
inline inline
void convertEdgeToFeatureSelection(MeshT* _mesh) { void convertEdgeSelectionToFeatureEdges(MeshT* _mesh) {
for (typename MeshT::EdgeIter e_it = _mesh->edges_begin(); e_it != _mesh->edges_end(); ++e_it) { for (typename MeshT::EdgeIter e_it = _mesh->edges_begin(); e_it != _mesh->edges_end(); ++e_it) {
...@@ -696,7 +736,7 @@ void convertEdgeToFeatureSelection(MeshT* _mesh) { ...@@ -696,7 +736,7 @@ void convertEdgeToFeatureSelection(MeshT* _mesh) {
template< typename MeshT > template< typename MeshT >
inline inline
void convertFeatureToEdgeSelection(MeshT* _mesh) { void convertFeatureEdgesToEdgeSelection(MeshT* _mesh) {
for (typename MeshT::EdgeIter e_it = _mesh->edges_begin(); e_it != _mesh->edges_end(); ++e_it) { for (typename MeshT::EdgeIter e_it = _mesh->edges_begin(); e_it != _mesh->edges_end(); ++e_it) {
...@@ -711,7 +751,7 @@ void convertFeatureToEdgeSelection(MeshT* _mesh) { ...@@ -711,7 +751,7 @@ void convertFeatureToEdgeSelection(MeshT* _mesh) {
template< typename MeshT > template< typename MeshT >
inline inline
void clearFeatureSelection(MeshT* _mesh) { void clearFeatureEdges(MeshT* _mesh) {
for (typename MeshT::EdgeIter e_it = _mesh->edges_begin(); e_it != _mesh->edges_end(); ++e_it) { for (typename MeshT::EdgeIter e_it = _mesh->edges_begin(); e_it != _mesh->edges_end(); ++e_it) {
...@@ -1107,6 +1147,46 @@ void convertFaceToHalfedgeSelection(MeshT* _mesh) { ...@@ -1107,6 +1147,46 @@ void convertFaceToHalfedgeSelection(MeshT* _mesh) {
} }
} }
template< typename MeshT >
inline
void convertFaceSelectionToFeatureFaces(MeshT* _mesh) {
for (typename MeshT::FaceIter f_it = _mesh->faces_begin(); f_it != _mesh->faces_end(); ++f_it) {
if (_mesh->status(f_it).selected()) {
_mesh->status(f_it).set_feature(true);
} else {
_mesh->status(f_it).set_feature(false);
}
}
}
template< typename MeshT >
inline
void convertFeatureFacesToFaceSelection(MeshT* _mesh) {
for (typename MeshT::FaceIter f_it = _mesh->faces_begin(); f_it != _mesh->faces_end(); ++f_it) {
if (_mesh->status(f_it).feature()) {
_mesh->status(f_it).set_selected(true);
} else {
_mesh->status(f_it).set_selected(false);
}
}
}
template< typename MeshT >
inline
void clearFeatureFaces(MeshT* _mesh) {
for (typename MeshT::FaceIter f_it = _mesh->faces_begin(); f_it != _mesh->faces_end(); ++f_it) {
_mesh->status(f_it).set_feature(false);
}
}
//============================================================================= //=============================================================================
} // MeshSelection Namespace } // MeshSelection Namespace
//============================================================================= //=============================================================================
...@@ -183,6 +183,27 @@ template< typename MeshT > ...@@ -183,6 +183,27 @@ template< typename MeshT >
inline inline
void convertVertexToFaceSelection(MeshT* _mesh); void convertVertexToFaceSelection(MeshT* _mesh);
/**
* Convert vertex selection to feature selection
*/
template< typename MeshT >
inline
void convertVertexSelectionToFeatureVertices(MeshT* _mesh);
/**
* Convert feature selection to vertex selection
*/
template< typename MeshT >
inline
void convertFeatureVerticesToVertexSelection(MeshT* _mesh);
/**
* Clear all features
*/
template< typename MeshT >
inline
void clearFeatureVertices(MeshT* _mesh);
/** @} */ /** @} */
//=========================================================================== //===========================================================================
...@@ -309,21 +330,21 @@ void convertEdgeToHalfedgeSelection(MeshT* _mesh); ...@@ -309,21 +330,21 @@ void convertEdgeToHalfedgeSelection(MeshT* _mesh);
*/ */
template< typename MeshT > template< typename MeshT >
inline inline
void convertEdgeToFeatureSelection(MeshT* _mesh); void convertEdgeSelectionToFeatureEdges(MeshT* _mesh);
/** /**
* Convert feature selection to edge selection * Convert feature selection to edge selection
*/ */
template< typename MeshT > template< typename MeshT >
inline inline
void convertFeatureToEdgeSelection(MeshT* _mesh); void convertFeatureEdgesToEdgeSelection(MeshT* _mesh);
/** /**
* Clear all features * Clear all features
*/ */
template< typename MeshT > template< typename MeshT >
inline inline
void clearFeatureSelection(MeshT* _mesh); void clearFeatureEdges(MeshT* _mesh);
/** @} */ /** @} */
...@@ -481,6 +502,27 @@ template< typename MeshT > ...@@ -481,6 +502,27 @@ template< typename MeshT >
inline inline
void convertFaceToHalfedgeSelection(MeshT* _mesh); void convertFaceToHalfedgeSelection(MeshT* _mesh);
/**
* Convert face selection to feature selection
*/
template< typename MeshT >
inline
void convertFaceSelectionToFeatureFaces(MeshT* _mesh);
/**
* Convert feature selection to edge selection
*/
template< typename MeshT >
inline
void convertFeatureFacesToFaceSelection(MeshT* _mesh);
/**
* Clear all features
*/
template< typename MeshT >
inline
void clearFeatureFaces(MeshT* _mesh);
/** @} */ /** @} */
//============================================================================= //=============================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment