mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-08 18:40:55 +03:00
94 lines
3.8 KiB
Plaintext
Executable File
94 lines
3.8 KiB
Plaintext
Executable File
-- Created on: 2004-06-10
|
|
-- Created by: Alexander SOLOVYOV
|
|
-- Copyright (c) 2004-2012 OPEN CASCADE SAS
|
|
--
|
|
-- The content of this file is subject to the Open CASCADE Technology Public
|
|
-- License Version 6.5 (the "License"). You may not use the content of this file
|
|
-- except in compliance with the License. Please obtain a copy of the License
|
|
-- at http://www.opencascade.org and read it completely before using this file.
|
|
--
|
|
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
--
|
|
-- The Original Code and all software distributed under the License is
|
|
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
-- Initial Developer hereby disclaims all such warranties, including without
|
|
-- limitation, any warranties of merchantability, fitness for a particular
|
|
-- purpose or non-infringement. Please see the License for the specific terms
|
|
-- and conditions governing the rights and limitations under the License.
|
|
|
|
|
|
class DataSource from XSDRAWSTLVRML inherits DataSource from MeshVS
|
|
|
|
---Purpose: The sample DataSource for working with STLMesh_Mesh
|
|
|
|
uses
|
|
Mesh from StlMesh,
|
|
|
|
Integer from Standard,
|
|
Boolean from Standard,
|
|
Address from Standard,
|
|
|
|
Array1OfReal from TColStd,
|
|
Array1OfInteger from TColStd,
|
|
SequenceOfInteger from TColStd,
|
|
PackedMapOfInteger from TColStd,
|
|
|
|
EntityType from MeshVS,
|
|
|
|
HArray2OfInteger from TColStd,
|
|
HArray2OfReal from TColStd
|
|
|
|
is
|
|
|
|
Create ( aMesh : Mesh from StlMesh ) returns mutable DataSource from XSDRAWSTLVRML;
|
|
---Purpose: Constructor
|
|
|
|
GetGeom ( me; ID : Integer;
|
|
IsElement : Boolean;
|
|
Coords : out Array1OfReal;
|
|
NbNodes : out Integer;
|
|
Type : out EntityType ) returns Boolean;
|
|
---Purpose: Returns geometry information about node ( if IsElement is False ) or element ( IsElement is True )
|
|
-- by co-ordinates. For element this method must return all its nodes co-ordinates in the strict order: X, Y, Z and
|
|
-- with nodes order is the same as in wire bounding the face or link. NbNodes is number of nodes of element.
|
|
-- It is recommended to return 1 for node. Type is an element type.
|
|
|
|
GetGeomType ( me; ID : Integer;
|
|
IsElement : Boolean;
|
|
Type : out EntityType ) returns Boolean;
|
|
---Purpose: This method is similar to GetGeom, but returns only element or node type. This method is provided for
|
|
-- a fine performance.
|
|
|
|
GetAddr ( me; ID : Integer;
|
|
IsElement : Boolean ) returns Address;
|
|
---Purpose: This method returns by number an address of any entity which represents element or node data structure.
|
|
|
|
GetNodesByElement ( me; ID : Integer;
|
|
NodeIDs : out Array1OfInteger from TColStd;
|
|
NbNodes : out Integer ) returns Boolean is redefined;
|
|
---Purpose: This method returns information about what node this element consist of.
|
|
|
|
GetAllNodes ( me ) returns PackedMapOfInteger;
|
|
---C++: return const &
|
|
---Purpose: This method returns map of all nodes the object consist of.
|
|
|
|
GetAllElements ( me ) returns PackedMapOfInteger;
|
|
---C++: return const &
|
|
---Purpose: This method returns map of all elements the object consist of.
|
|
|
|
GetNormal ( me; Id : Integer; Max : Integer;
|
|
nx, ny, nz : out Real ) returns Boolean is redefined virtual;
|
|
---Purpose: This method calculates normal of face, which is using for correct reflection presentation.
|
|
-- There is default method, for advance reflection this method can be redefined.
|
|
|
|
fields
|
|
myMesh : Mesh from StlMesh;
|
|
myNodes : PackedMapOfInteger from TColStd;
|
|
myElements : PackedMapOfInteger from TColStd;
|
|
myElemNodes : HArray2OfInteger from TColStd;
|
|
|
|
myNodeCoords, myElemNormals : HArray2OfReal from TColStd;
|
|
|
|
end DataSource;
|