diff --git a/ObjectTypes/VolumeMeshObject/VolumeMeshBufferManager.hh b/ObjectTypes/VolumeMeshObject/VolumeMeshBufferManager.hh index ebc2346448b9694591690486a38af64f2a1553f4..47831062a0dad8a0668fd94409612e247f522368 100644 --- a/ObjectTypes/VolumeMeshObject/VolumeMeshBufferManager.hh +++ b/ObjectTypes/VolumeMeshObject/VolumeMeshBufferManager.hh @@ -316,6 +316,13 @@ private: /// Calculates for all cells whether they are inside w.r.t. all cut planes void calculateCellInsideness(); + bool should_render(const VertexHandle& _vh); + bool should_render(const HalfEdgeHandle& _heh); + bool should_render(const EdgeHandle& _eh); + bool should_render(const HalfFaceHandle& _hfh); + bool should_render(const FaceHandle& _fh); + bool should_render(const CellHandle& _ch); + /// Tests whether the options were changed since the last time building the buffer bool optionsChanged(); diff --git a/ObjectTypes/VolumeMeshObject/VolumeMeshBufferManagerT_impl.hh b/ObjectTypes/VolumeMeshObject/VolumeMeshBufferManagerT_impl.hh index 25f8d232038539e07637e05690fa03b59ead38f9..5f75212244fbf0503e523a4f6d548f8b7f75099b 100644 --- a/ObjectTypes/VolumeMeshObject/VolumeMeshBufferManagerT_impl.hh +++ b/ObjectTypes/VolumeMeshObject/VolumeMeshBufferManagerT_impl.hh @@ -578,12 +578,63 @@ bool VolumeMeshBufferManager<VolumeMesh>::is_inside(const FaceHandle& _fh) template <class VolumeMesh> bool VolumeMeshBufferManager<VolumeMesh>::is_inside(const CellHandle& _ch) { + if (mStatusAttrib[_ch].hidden()) + return false; + if (!mCellInsidenessValid) calculateCellInsideness(); return mCellInsideness[_ch.idx()]; } +template <class VolumeMesh> +bool VolumeMeshBufferManager<VolumeMesh>::should_render(const VertexHandle& _vh) +{ + if (mStatusAttrib[_vh].hidden()) + return false; + return is_inside(_vh); +} + +template <class VolumeMesh> +bool VolumeMeshBufferManager<VolumeMesh>::should_render(const HalfEdgeHandle& _heh) +{ + if (mStatusAttrib[_heh].hidden()) + return false; + return is_inside(_heh); +} + +template <class VolumeMesh> +bool VolumeMeshBufferManager<VolumeMesh>::should_render(const EdgeHandle& _eh) +{ + if (mStatusAttrib[_eh].hidden()) + return false; + return is_inside(_eh); +} + +template <class VolumeMesh> +bool VolumeMeshBufferManager<VolumeMesh>::should_render(const HalfFaceHandle& _hfh) +{ + if (mStatusAttrib[_hfh].hidden()) + return false; + return is_inside(_hfh); +} + +template <class VolumeMesh> +bool VolumeMeshBufferManager<VolumeMesh>::should_render(const FaceHandle& _fh) +{ + if (mStatusAttrib[_fh].hidden()) + return false; + return is_inside(_fh); +} + +template <class VolumeMesh> +bool VolumeMeshBufferManager<VolumeMesh>::should_render(const CellHandle& _ch) +{ + if (mStatusAttrib[_ch].hidden()) + return false; + return is_inside(_ch); +} + /** * @brief Calculates for all cells whether they are inside w.r.t. all cut planes @@ -704,18 +755,20 @@ void VolumeMeshBufferManager<VolumeMesh>::countNumOfVertices() { OpenVolumeMesh::CellIter c_begin(mMesh.cells_begin()), c_end(mMesh.cells_end()); for (OpenVolumeMesh::CellIter c_it = c_begin; c_it != c_end; ++c_it) - if (mStatusAttrib[*c_it].selected() && is_inside(*c_it)) + { + if (mStatusAttrib[*c_it].selected() && should_render(*c_it)) { std::vector<HalfFaceHandle> hfs = mMesh.cell(*c_it).halffaces(); for (unsigned int i = 0; i < hfs.size(); ++i) numOfVertices += ((mMesh.valence(mMesh.face_handle(hfs[i])))-2)*3; } + } } else if (mPrimitiveMode == PM_FACES) { OpenVolumeMesh::FaceIter f_begin(mMesh.faces_begin()), f_end(mMesh.faces_end()); for (OpenVolumeMesh::FaceIter f_it = f_begin; f_it != f_end; ++f_it) - if (mStatusAttrib[*f_it].selected() && is_inside(*f_it) && (!mBoundaryOnly || mMesh.is_boundary(*f_it))) + if (mStatusAttrib[*f_it].selected() && should_render(*f_it) && (!mBoundaryOnly || mMesh.is_boundary(*f_it))) numOfVertices += ((mMesh.valence(*f_it))-2)*3; //additional vertices are added for faces with more than 3 adjacent vertices } else if (mPrimitiveMode == PM_FACES_ON_CELLS) @@ -729,14 +782,14 @@ void VolumeMeshBufferManager<VolumeMesh>::countNumOfVertices() { OpenVolumeMesh::HalfFaceIter hf_begin(mMesh.halffaces_begin()), hf_end(mMesh.halffaces_end()); for (OpenVolumeMesh::HalfFaceIter hf_it = hf_begin; hf_it != hf_end; ++hf_it) - if (mStatusAttrib[*hf_it].selected() && is_inside(*hf_it) && (!mBoundaryOnly || mMesh.is_boundary(*hf_it))) + if (mStatusAttrib[*hf_it].selected() && should_render(*hf_it) && (!mBoundaryOnly || mMesh.is_boundary(*hf_it))) numOfVertices += ((mMesh.valence(mMesh.face_handle(*hf_it)))-2)*3; //additional vertices are added for faces with more than 3 adjacent vertices } else if (mPrimitiveMode == PM_EDGES) { OpenVolumeMesh::EdgeIter e_begin(mMesh.edges_begin()), e_end(mMesh.edges_end()); for (OpenVolumeMesh::EdgeIter e_it = e_begin; e_it != e_end; ++e_it) - if (mStatusAttrib[*e_it].selected() && is_inside(*e_it) && (!mBoundaryOnly || mMesh.is_boundary(*e_it))) + if (mStatusAttrib[*e_it].selected() && should_render(*e_it) && (!mBoundaryOnly || mMesh.is_boundary(*e_it))) numOfVertices += 2; } else if (mPrimitiveMode == PM_EDGES_ON_CELLS) @@ -750,14 +803,14 @@ void VolumeMeshBufferManager<VolumeMesh>::countNumOfVertices() { OpenVolumeMesh::HalfEdgeIter he_begin(mMesh.halfedges_begin()), he_end(mMesh.halfedges_end()); for (OpenVolumeMesh::HalfEdgeIter he_it = he_begin; he_it != he_end; ++he_it) - if (mStatusAttrib[*he_it].selected() && is_inside(*he_it) && (!mBoundaryOnly || mMesh.is_boundary(*he_it))) + if (mStatusAttrib[*he_it].selected() && should_render(*he_it) && (!mBoundaryOnly || mMesh.is_boundary(*he_it))) numOfVertices += 2; } else if (mPrimitiveMode == PM_VERTICES) { OpenVolumeMesh::VertexIter v_begin(mMesh.vertices_begin()), v_end(mMesh.vertices_end()); for (OpenVolumeMesh::VertexIter v_it = v_begin; v_it != v_end; ++v_it) - if (mStatusAttrib[*v_it].selected() && is_inside(*v_it) && (!mBoundaryOnly || mMesh.is_boundary(*v_it))) + if (mStatusAttrib[*v_it].selected() && should_render(*v_it) && (!mBoundaryOnly || mMesh.is_boundary(*v_it))) numOfVertices += 1; } else if (mPrimitiveMode == PM_VERTICES_ON_CELLS) @@ -778,14 +831,14 @@ void VolumeMeshBufferManager<VolumeMesh>::countNumOfVertices() else if (mPrimitiveMode == PM_VERTICES) { for (unsigned int i = 0; i < mMesh.n_vertices(); i++) - if (is_inside(VertexHandle(i)) && (!mBoundaryOnly || mMesh.is_boundary(VertexHandle(i)))) + if (should_render(VertexHandle(i)) && (!mBoundaryOnly || mMesh.is_boundary(VertexHandle(i)))) numOfVertices += 1; } else if (mPrimitiveMode == PM_FACES) { OpenVolumeMesh::FaceIter f_begin(mMesh.faces_begin()), f_end(mMesh.faces_end()); for (OpenVolumeMesh::FaceIter f_it = f_begin; f_it != f_end; ++f_it) - if (is_inside(*f_it) && (!mBoundaryOnly || mMesh.is_boundary(*f_it))) + if (should_render(*f_it) && (!mBoundaryOnly || mMesh.is_boundary(*f_it))) numOfVertices += ((mMesh.valence(*f_it))-2)*3; //additional vertices are added for faces with more than 3 adjacent vertices } else if (mPrimitiveMode == PM_FACES_ON_CELLS) @@ -798,7 +851,7 @@ void VolumeMeshBufferManager<VolumeMesh>::countNumOfVertices() { OpenVolumeMesh::HalfFaceIter hf_begin(mMesh.halffaces_begin()), hf_end(mMesh.halffaces_end()); for (OpenVolumeMesh::HalfFaceIter hf_it = hf_begin; hf_it != hf_end; ++hf_it) - if (is_inside(*hf_it) && (!mBoundaryOnly || mMesh.is_boundary(*hf_it))) + if (should_render(*hf_it) && (!mBoundaryOnly || mMesh.is_boundary(*hf_it))) numOfVertices += ((mMesh.valence(mMesh.face_handle(*hf_it)))-2)*3; //additional vertices are added for faces with more than 3 adjacent vertices } else if (mPrimitiveMode == PM_CELLS) @@ -806,7 +859,7 @@ void VolumeMeshBufferManager<VolumeMesh>::countNumOfVertices() OpenVolumeMesh::CellIter c_begin(mMesh.cells_begin()), c_end(mMesh.cells_end()); for (OpenVolumeMesh::CellIter c_it = c_begin; c_it != c_end; ++c_it) { - if (is_inside(*c_it)) + if (should_render(*c_it)) { std::vector<HalfFaceHandle> hfs = mMesh.cell(*c_it).halffaces(); for (unsigned int i = 0; i < hfs.size(); ++i) @@ -822,13 +875,13 @@ void VolumeMeshBufferManager<VolumeMesh>::countNumOfVertices() else if ( mPrimitiveMode == PM_EDGES ) //all edges are drawn, so irregular ones are already included { for (OpenVolumeMesh::EdgeIter e_it = mMesh.edges_begin(); e_it != mMesh.edges_end(); ++e_it) - if (is_inside(*e_it) && (!mBoundaryOnly || mMesh.is_boundary(*e_it))) + if (should_render(*e_it) && (!mBoundaryOnly || mMesh.is_boundary(*e_it))) numOfVertices += 2; } else if ( mPrimitiveMode == PM_IRREGULAR_EDGES ) { for (OpenVolumeMesh::EdgeIter e_it = mMesh.edges_begin(); e_it != mMesh.edges_end(); ++e_it) - if (is_inside(*e_it) && (!mBoundaryOnly || mMesh.is_boundary(*e_it))) + if (should_render(*e_it) && (!mBoundaryOnly || mMesh.is_boundary(*e_it))) { bool boundary = mMesh.is_boundary(*e_it); unsigned int valence = mMesh.valence(*e_it); @@ -848,7 +901,7 @@ void VolumeMeshBufferManager<VolumeMesh>::countNumOfVertices() else if ( mPrimitiveMode == PM_HALFEDGES ) { for (OpenVolumeMesh::HalfEdgeIter he_it = mMesh.halfedges_begin(); he_it != mMesh.halfedges_end(); ++he_it) - if (is_inside(*he_it) && (!mBoundaryOnly || mMesh.is_boundary(*he_it))) + if (should_render(*he_it) && (!mBoundaryOnly || mMesh.is_boundary(*he_it))) numOfVertices += 2; } else /*if ( mPrimitiveMode == PM_NONE)*/ @@ -873,11 +926,11 @@ int VolumeMeshBufferManager<VolumeMesh>::getNumOfIncidentCells(OpenVolumeMesh::F int incidentCells = 0; OpenVolumeMesh::HalfFaceHandle hf0 = mMesh.halfface_handle(_fh, 0); if (mMesh.incident_cell(hf0) != CellHandle(-1)) - if (is_inside(mMesh.incident_cell(hf0))) + if (should_render(mMesh.incident_cell(hf0))) incidentCells += 1; OpenVolumeMesh::HalfFaceHandle hf1 = mMesh.halfface_handle(_fh, 1); if (mMesh.incident_cell(hf1) != CellHandle(-1)) - if (is_inside(mMesh.incident_cell(hf1))) + if (should_render(mMesh.incident_cell(hf1))) incidentCells += 1; return incidentCells; } @@ -896,7 +949,7 @@ int VolumeMeshBufferManager<VolumeMesh>::getNumOfIncidentCells(OpenVolumeMesh::E OpenVolumeMesh::HalfEdgeHandle heh = mMesh.halfedge_handle(_eh, 0); for (OpenVolumeMesh::HalfEdgeCellIter hec_it = OpenVolumeMesh::HalfEdgeCellIter(heh,&mMesh); hec_it.valid(); ++hec_it) if (hec_it->idx() != -1) - if (is_inside(*hec_it)) + if (should_render(*hec_it)) incidentCells++; return incidentCells; } @@ -914,7 +967,7 @@ int VolumeMeshBufferManager<VolumeMesh>::getNumOfIncidentCells(OpenVolumeMesh::V int incidentCells = 0; for (OpenVolumeMesh::VertexCellIter vc_it = OpenVolumeMesh::VertexCellIter(_vh,&mMesh); vc_it; ++vc_it) if (vc_it->idx() != -1) - if (is_inside(*vc_it)) + if (should_render(*vc_it)) incidentCells++; return incidentCells; } @@ -1046,7 +1099,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildVertexBuffer(unsigned char* _buff { for (unsigned int i = 0; i < mMesh.n_vertices(); ++i) { if (mSkipUnselected && !mStatusAttrib[VertexHandle(i)].selected()) continue; - if (!is_inside(VertexHandle(i))) continue; + if (!should_render(VertexHandle(i))) continue; if (mBoundaryOnly && !mMesh.is_boundary(VertexHandle(i))) continue; ACG::Vec3d p = mMesh.vertex(VertexHandle(i)); addPositionToBuffer(p, _buffer, pos++); @@ -1061,7 +1114,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildVertexBuffer(unsigned char* _buff { ACG::Vec3d cog = getCOG(*vc_it); //ACG::Vec3d newPos = p*mScale + cog*(1-mScale); - if (is_inside(*vc_it)) + if (should_render(*vc_it)) addPositionToBuffer(p*mScale + cog*(1-mScale), _buffer, pos++); } } @@ -1074,7 +1127,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildVertexBuffer(unsigned char* _buff { if (mSkipUnselected && !mStatusAttrib[*f_it].selected()) continue; if (mBoundaryOnly && !mMesh.is_boundary(*f_it)) continue; - if (!is_inside(*f_it)) continue; + if (!should_render(*f_it)) continue; vertices.clear(); for (OpenVolumeMesh::HalfFaceVertexIter hfv_it = mMesh.hfv_iter(mMesh.halfface_handle(*f_it,0)); hfv_it; ++hfv_it) vertices.push_back(mMesh.vertex(*hfv_it)); @@ -1103,7 +1156,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildVertexBuffer(unsigned char* _buff OpenVolumeMesh::CellHandle ch = mMesh.incident_cell(mMesh.halfface_handle(*f_it,i)); if (ch != CellHandle(-1)) { - if (!is_inside(ch)) continue; + if (!should_render(ch)) continue; ACG::Vec3d cog = getCOG(ch); for (unsigned int i = 0; i < vertices.size()-2; i++) { @@ -1125,7 +1178,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildVertexBuffer(unsigned char* _buff { if (mSkipUnselected && !mStatusAttrib[*hf_it].selected()) continue; if (mBoundaryOnly && !mMesh.is_boundary(*hf_it)) continue; - if (!is_inside(*hf_it)) continue; + if (!should_render(*hf_it)) continue; vertices.clear(); for (OpenVolumeMesh::HalfFaceVertexIter hfv_it = mMesh.hfv_iter(*hf_it); hfv_it; ++hfv_it) vertices.push_back(mMesh.vertex(*hfv_it)); @@ -1145,7 +1198,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildVertexBuffer(unsigned char* _buff for (OpenVolumeMesh::CellIter c_it = c_begin; c_it != c_end; ++c_it) { if (mSkipUnselected && !mStatusAttrib[*c_it].selected()) continue; - if (!is_inside(*c_it)) continue; + if (!should_render(*c_it)) continue; std::vector<HalfFaceHandle> hfs = mMesh.cell(*c_it).halffaces(); ACG::Vec3d cog = getCOG(*c_it); for (unsigned int i = 0; i < hfs.size(); ++i) @@ -1171,7 +1224,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildVertexBuffer(unsigned char* _buff { if (mSkipUnselected && !mStatusAttrib[*e_it].selected()) continue; if (mBoundaryOnly && !mMesh.is_boundary(*e_it)) continue; - if (!is_inside(*e_it)) continue; + if (!should_render(*e_it)) continue; Edge e(mMesh.edge(*e_it)); addPositionToBuffer(mMesh.vertex(e.from_vertex()), _buffer, pos++); @@ -1191,7 +1244,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildVertexBuffer(unsigned char* _buff { if (hec_it->idx() != -1) { - if (!is_inside(*hec_it)) continue; + if (!should_render(*hec_it)) continue; ACG::Vec3d cog = getCOG(*hec_it); addPositionToBuffer(mMesh.vertex(e.from_vertex())*mScale + cog*(1-mScale), _buffer, pos++); addPositionToBuffer(mMesh.vertex(e.to_vertex()) *mScale + cog*(1-mScale), _buffer, pos++); @@ -1206,7 +1259,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildVertexBuffer(unsigned char* _buff { if (mSkipUnselected && !mStatusAttrib[*e_it].selected()) continue; if (mBoundaryOnly && !mMesh.is_boundary(*e_it)) continue; - if (!is_inside(*e_it)) continue; + if (!should_render(*e_it)) continue; bool boundary = mMesh.is_boundary(*e_it); unsigned int valence = mMesh.valence(*e_it); @@ -1232,7 +1285,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildVertexBuffer(unsigned char* _buff { if (mSkipUnselected && !mStatusAttrib[*he_it].selected()) continue; if (mBoundaryOnly && !mMesh.is_boundary(*he_it)) continue; - if (!is_inside(*he_it)) continue; + if (!should_render(*he_it)) continue; double lambda = 0.4; Edge e(mMesh.halfedge(*he_it)); @@ -1264,7 +1317,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildNormalBuffer(unsigned char* _buff for (OpenVolumeMesh::FaceIter f_it = f_begin; f_it != f_end; ++f_it) { if (mBoundaryOnly && !mMesh.is_boundary(*f_it)) continue; - if (!is_inside(*f_it)) continue; + if (!should_render(*f_it)) continue; ACG::Vec3d normal = mNormalAttrib[*f_it]; unsigned int numOfVerticesInFace = mMesh.valence(*f_it); @@ -1283,7 +1336,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildNormalBuffer(unsigned char* _buff for (OpenVolumeMesh::FaceIter f_it = f_begin; f_it != f_end; ++f_it) { if (mBoundaryOnly && !mMesh.is_boundary(*f_it)) continue; - if (!is_inside(*f_it)) continue; + if (!should_render(*f_it)) continue; normals.clear(); for (OpenVolumeMesh::HalfFaceVertexIter hfv_it = mMesh.hfv_iter(mMesh.halfface_handle(*f_it,0)); hfv_it; ++hfv_it) normals.push_back(mNormalAttrib[*hfv_it]); @@ -1302,7 +1355,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildNormalBuffer(unsigned char* _buff for (OpenVolumeMesh::HalfFaceIter hf_it = hf_begin; hf_it != hf_end; ++hf_it) { if (mBoundaryOnly && !mMesh.is_boundary(*hf_it)) continue; - if (!is_inside(*hf_it)) continue; + if (!should_render(*hf_it)) continue; ACG::Vec3d normal = mNormalAttrib[*hf_it]; unsigned int numOfVerticesInCell = 0; for (OpenVolumeMesh::HalfFaceVertexIter hfv_it = mMesh.hfv_iter(*hf_it); hfv_it; ++hfv_it) @@ -1323,7 +1376,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildNormalBuffer(unsigned char* _buff for (OpenVolumeMesh::HalfFaceIter hf_it = hf_begin; hf_it != hf_end; ++hf_it) { if (mBoundaryOnly && !mMesh.is_boundary(*hf_it)) continue; - if (!is_inside(*hf_it)) continue; + if (!should_render(*hf_it)) continue; normals.clear(); for (OpenVolumeMesh::HalfFaceVertexIter hfv_it = mMesh.hfv_iter(*hf_it); hfv_it; ++hfv_it) normals.push_back(mNormalAttrib[*hfv_it]); @@ -1341,7 +1394,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildNormalBuffer(unsigned char* _buff OpenVolumeMesh::CellIter c_begin(mMesh.cells_begin()), c_end(mMesh.cells_end()); for (OpenVolumeMesh::CellIter c_it = c_begin; c_it != c_end; ++c_it) { - if (!is_inside(*c_it)) continue; + if (!should_render(*c_it)) continue; std::vector<HalfFaceHandle> hfs = mMesh.cell(*c_it).halffaces(); for (unsigned int i = 0; i < hfs.size(); ++i) { @@ -1363,7 +1416,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildNormalBuffer(unsigned char* _buff OpenVolumeMesh::CellIter c_begin(mMesh.cells_begin()), c_end(mMesh.cells_end()); for (OpenVolumeMesh::CellIter c_it = c_begin; c_it != c_end; ++c_it) { - if (!is_inside(*c_it)) continue; + if (!should_render(*c_it)) continue; std::vector<HalfFaceHandle> hfs = mMesh.cell(*c_it).halffaces(); for (unsigned int i = 0; i < hfs.size(); ++i) @@ -1399,7 +1452,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe for (unsigned int i = 0; i < mMesh.n_vertices(); ++i) { if (mBoundaryOnly && !mMesh.is_boundary(VertexHandle(i))) continue; - if (!is_inside(VertexHandle(i))) continue; + if (!should_render(VertexHandle(i))) continue; ACG::Vec4f color = mColorAttrib[VertexHandle(i)]; addColorToBuffer(color, _buffer, pos++); } @@ -1411,7 +1464,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe for (OpenVolumeMesh::FaceIter f_it = f_begin; f_it != f_end; ++f_it) { if (mBoundaryOnly && !mMesh.is_boundary(*f_it)) continue; - if (!is_inside(*f_it)) continue; + if (!should_render(*f_it)) continue; colors.clear(); for (OpenVolumeMesh::HalfFaceVertexIter hfv_it = mMesh.hfv_iter(mMesh.halfface_handle(*f_it,0)); hfv_it; ++hfv_it) @@ -1431,7 +1484,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe for (OpenVolumeMesh::FaceIter f_it = f_begin; f_it != f_end; ++f_it) { if (mBoundaryOnly && !mMesh.is_boundary(*f_it)) continue; - if (!is_inside(*f_it)) continue; + if (!should_render(*f_it)) continue; ACG::Vec4f color = mColorAttrib[*f_it]; unsigned int numOfVerticesInFace = mMesh.valence(*f_it); @@ -1447,7 +1500,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe for (OpenVolumeMesh::HalfFaceIter hf_it = hf_begin; hf_it != hf_end; ++hf_it) { if (mBoundaryOnly && !mMesh.is_boundary(*hf_it)) continue; - if (!is_inside(*hf_it)) continue; + if (!should_render(*hf_it)) continue; ACG::Vec4f color = mColorAttrib[*hf_it]; unsigned int numOfVerticesInFace = mMesh.valence(mMesh.face_handle(*hf_it)); @@ -1464,7 +1517,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe for (OpenVolumeMesh::HalfFaceIter hf_it = hf_begin; hf_it != hf_end; ++hf_it) { if (mBoundaryOnly && !mMesh.is_boundary(*hf_it)) continue; - if (!is_inside(*hf_it)) continue; + if (!should_render(*hf_it)) continue; colors.clear(); for (OpenVolumeMesh::HalfFaceVertexIter hfv_it = mMesh.hfv_iter(*hf_it); hfv_it; ++hfv_it) @@ -1483,7 +1536,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe OpenVolumeMesh::CellIter c_begin(mMesh.cells_begin()), c_end(mMesh.cells_end()); for (OpenVolumeMesh::CellIter c_it = c_begin; c_it != c_end; ++c_it) { - if (!is_inside(*c_it)) continue; + if (!should_render(*c_it)) continue; ACG::Vec4f color = mColorAttrib[*c_it]; std::vector<HalfFaceHandle> hfs = mMesh.cell(*c_it).halffaces(); for (unsigned int i = 0; i < hfs.size(); ++i) @@ -1503,7 +1556,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe OpenVolumeMesh::CellIter c_begin(mMesh.cells_begin()), c_end(mMesh.cells_end()); for (OpenVolumeMesh::CellIter c_it = c_begin; c_it != c_end; ++c_it) { - if (!is_inside(*c_it)) continue; + if (!should_render(*c_it)) continue; std::vector<HalfFaceHandle> hfs = mMesh.cell(*c_it).halffaces(); for (unsigned int i = 0; i < hfs.size(); ++i) { @@ -1523,7 +1576,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe OpenVolumeMesh::CellIter c_begin(mMesh.cells_begin()), c_end(mMesh.cells_end()); for (OpenVolumeMesh::CellIter c_it = c_begin; c_it != c_end; ++c_it) { - if (!is_inside(*c_it)) continue; + if (!should_render(*c_it)) continue; std::vector<HalfFaceHandle> hfs = mMesh.cell(*c_it).halffaces(); for (unsigned int i = 0; i < hfs.size(); ++i) { @@ -1544,7 +1597,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe OpenVolumeMesh::CellIter c_begin(mMesh.cells_begin()), c_end(mMesh.cells_end()); for (OpenVolumeMesh::CellIter c_it = c_begin; c_it != c_end; ++c_it) { - if (!is_inside(*c_it)) continue; + if (!should_render(*c_it)) continue; std::vector<HalfFaceHandle> hfs = mMesh.cell(*c_it).halffaces(); for (unsigned int i = 0; i < hfs.size(); ++i) { @@ -1567,7 +1620,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe for (OpenVolumeMesh::EdgeIter e_it = e_begin; e_it != e_end; ++e_it) { if (mBoundaryOnly && !mMesh.is_boundary(*e_it)) continue; - if (!is_inside(*e_it)) continue; + if (!should_render(*e_it)) continue; ACG::Vec4f color = mColorAttrib[*e_it]; addColorToBuffer(color, _buffer, pos++); addColorToBuffer(color, _buffer, pos++); @@ -1579,7 +1632,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe for (OpenVolumeMesh::EdgeIter e_it = e_begin; e_it != e_end; ++e_it) { if (mBoundaryOnly && !mMesh.is_boundary(*e_it)) continue; - if (!is_inside(*e_it)) continue; + if (!should_render(*e_it)) continue; bool boundary = mMesh.is_boundary(*e_it); unsigned int valence = mMesh.valence(*e_it); @@ -1606,7 +1659,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe for (OpenVolumeMesh::EdgeIter e_it = e_begin; e_it != e_end; ++e_it) { if (mBoundaryOnly && !mMesh.is_boundary(*e_it)) continue; - if (!is_inside(*e_it)) continue; + if (!should_render(*e_it)) continue; bool boundary = mMesh.is_boundary(*e_it); unsigned int valence = mMesh.valence(*e_it); @@ -1638,7 +1691,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildColorBuffer(unsigned char* _buffe for (OpenVolumeMesh::HalfEdgeIter he_it = he_begin; he_it != he_end; ++he_it) { if (mBoundaryOnly && !mMesh.is_boundary(*he_it)) continue; - if (!is_inside(*he_it)) continue; + if (!should_render(*he_it)) continue; ACG::Vec4f color = mColorAttrib[*he_it]; addColorToBuffer(color, _buffer, pos++); @@ -1669,7 +1722,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildTexCoordBuffer(unsigned char* _bu for (OpenVolumeMesh::FaceIter f_it = f_begin; f_it != f_end; ++f_it) { if (mBoundaryOnly && !mMesh.is_boundary(*f_it)) continue; - if (!is_inside(*f_it)) continue; + if (!should_render(*f_it)) continue; texCoords.clear(); for (OpenVolumeMesh::HalfFaceVertexIter hfv_it = mMesh.hfv_iter(mMesh.halfface_handle(*f_it,0)); hfv_it; ++hfv_it) @@ -1690,7 +1743,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildTexCoordBuffer(unsigned char* _bu for (OpenVolumeMesh::HalfFaceIter hf_it = hf_begin; hf_it != hf_end; ++hf_it) { if (mBoundaryOnly && !mMesh.is_boundary(*hf_it)) continue; - if (!is_inside(*hf_it)) continue; + if (!should_render(*hf_it)) continue; texCoords.clear(); for (OpenVolumeMesh::HalfFaceVertexIter hfv_it = mMesh.hfv_iter(*hf_it); hfv_it; ++hfv_it) @@ -1725,7 +1778,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildPickColorBuffer(ACG::GLState& _st for (unsigned int i = 0; i < mMesh.n_vertices(); ++i) { if (mBoundaryOnly && !mMesh.is_boundary(VertexHandle(i))) continue; - if (!is_inside(VertexHandle(i))) continue; + if (!should_render(VertexHandle(i))) continue; ACG::Vec4uc color = _state.pick_get_name_color(VertexHandle(i).idx() + _offset); addColorToBuffer(color, _buffer, pos++); } @@ -1745,7 +1798,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildPickColorBuffer(ACG::GLState& _st for (OpenVolumeMesh::EdgeIter e_it = e_begin; e_it != e_end; ++e_it) { if (mBoundaryOnly && !mMesh.is_boundary(*e_it)) continue; - if (!is_inside(*e_it)) continue; + if (!should_render(*e_it)) continue; ACG::Vec4uc color = _state.pick_get_name_color(e_it->idx()+_offset); addColorToBuffer(color, _buffer, pos++); addColorToBuffer(color, _buffer, pos++); @@ -1768,7 +1821,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildPickColorBuffer(ACG::GLState& _st for (OpenVolumeMesh::FaceIter f_it = f_begin; f_it != f_end; ++f_it) { if (mBoundaryOnly && !mMesh.is_boundary(*f_it)) continue; - if (!is_inside(*f_it)) continue; + if (!should_render(*f_it)) continue; ACG::Vec4uc color = _state.pick_get_name_color(f_it->idx()); unsigned int numOfVertices = 0; @@ -1795,7 +1848,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildPickColorBuffer(ACG::GLState& _st OpenVolumeMesh::CellHandle ch = mMesh.incident_cell(mMesh.halfface_handle(*f_it,i)); if (ch != CellHandle(-1)) { - if (!is_inside(ch)) continue; + if (!should_render(ch)) continue; for (unsigned int i = 0; i < (numOfVerticesInHalfface-2)*3; i++) addColorToBuffer(color, _buffer, pos++); } @@ -1807,7 +1860,7 @@ void VolumeMeshBufferManager<VolumeMesh>::buildPickColorBuffer(ACG::GLState& _st OpenVolumeMesh::CellIter c_begin(mMesh.cells_begin()), c_end(mMesh.cells_end()); for (OpenVolumeMesh::CellIter c_it = c_begin; c_it != c_end; ++c_it) { - if (!is_inside(*c_it)) continue; + if (!should_render(*c_it)) continue; ACG::Vec4uc color = _state.pick_get_name_color(c_it->idx()+_offset); std::vector<HalfFaceHandle> hfs = mMesh.cell(*c_it).halffaces(); for (unsigned int i = 0; i < hfs.size(); ++i) diff --git a/libs/OpenVolumeMesh b/libs/OpenVolumeMesh index 919e020da5b4b61a674a3e4c29b4c658a5c03b52..38009a60d5f428f5c3781746d4f90ef2ef4cba13 160000 --- a/libs/OpenVolumeMesh +++ b/libs/OpenVolumeMesh @@ -1 +1 @@ -Subproject commit 919e020da5b4b61a674a3e4c29b4c658a5c03b52 +Subproject commit 38009a60d5f428f5c3781746d4f90ef2ef4cba13