From 84bf82489726c472a6b8647bf346575f9f727eb5 Mon Sep 17 00:00:00 2001 From: vro Date: Wed, 10 Feb 2021 18:21:56 +0300 Subject: [PATCH] 0025936: Modeling Data - reusable data structure for 2D tesselation (3- and 4-nodal mesh) // Poly_Quad.hxx is added instead of Poly_Element.hxx --- src/Poly/Poly_Quad.hxx | 73 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/Poly/Poly_Quad.hxx diff --git a/src/Poly/Poly_Quad.hxx b/src/Poly/Poly_Quad.hxx new file mode 100644 index 0000000000..644fcfdc1f --- /dev/null +++ b/src/Poly/Poly_Quad.hxx @@ -0,0 +1,73 @@ +// Copyright (c) 2015 OPEN CASCADE SAS +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _Poly_Quad_HeaderFile +#define _Poly_Quad_HeaderFile + +#include +#include +#include + +//! Describes a quadric element of a mesh. +class Poly_Quad : public Poly_Triangle +{ + +public: + + DEFINE_STANDARD_ALLOC + + //! Constructs an empty Quad object. + Poly_Quad():myNode4 (0) { + myNodes[0] = myNodes[1] = myNodes[2] = 0; + } + + //! Constructs a quadric element. + Poly_Quad (const Standard_Integer theNode1, + const Standard_Integer theNode2, + const Standard_Integer theNode3, + const Standard_Integer theNode4) + { + Set (theNode1, theNode2, theNode3, theNode4); + } + + //! Sets indices of nodes. + void Set (const Standard_Integer theNode1, + const Standard_Integer theNode2, + const Standard_Integer theNode3, + const Standard_Integer theNode4) + { + myNodes[0] = theNode1; + myNodes[1] = theNode2; + myNodes[2] = theNode3; + myNode4 = theNode4; + } + + //! Returns indices of nodes of the quadric element. + void Get (Standard_Integer& theNode1, + Standard_Integer& theNode2, + Standard_Integer& theNode3, + Standard_Integer& theNode4) const + { + theNode1 = myNodes[0]; + theNode2 = myNodes[1]; + theNode3 = myNodes[2]; + theNode4 = myNode4; + } + +protected: + + Standard_Integer myNode4; + +}; + +#endif // _Poly_Quad_HeaderFile -- 2.39.5