0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / XCAFDoc / XCAFDoc_MaterialTool.cdl
CommitLineData
b311480e 1-- Created on: 2003-03-05
2-- Created by: Sergey KUUL
973c2be1 3-- Copyright (c) 2003-2014 OPEN CASCADE SAS
b311480e 4--
973c2be1 5-- This file is part of Open CASCADE Technology software library.
b311480e 6--
d5f74e42 7-- This library is free software; you can redistribute it and/or modify it under
8-- the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9-- by the Free Software Foundation, with special exception defined in the file
10-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11-- distribution for complete text of the license and disclaimer of any warranty.
b311480e 12--
973c2be1 13-- Alternatively, this file may be used under the terms of Open CASCADE
14-- commercial license or contractual agreement.
7fd59977 15
16class MaterialTool from XCAFDoc inherits Attribute from TDF
17
18 ---Purpose: Provides tools to store and retrieve attributes (materials)
19 -- of TopoDS_Shape in and from TDocStd_Document
20 -- A Document is intended to hold different
21 -- attributes of ONE shape and it's sub-shapes
ff8178ef 22 -- Provide tools for management of Materialss section of document.
7fd59977 23
24uses
25 Shape from TopoDS,
26 Label from TDF,
27 LabelSequence from TDF,
28 Document from TDocStd,
29 ShapeTool from XCAFDoc,
30 RelocationTable from TDF,
31 HAsciiString from TCollection
32
33is
34 Create returns MaterialTool from XCAFDoc;
35
36 Set (myclass; L : Label from TDF) returns MaterialTool from XCAFDoc;
37 ---Purpose: Creates (if not exist) MaterialTool.
38
39 GetID (myclass)
40 ---C++: return const &
41 returns GUID from Standard;
42
43
44 ---API: General structure
45
46 BaseLabel(me) returns Label from TDF;
47 ---Purpose: returns the label under which colors are stored
48
49 ShapeTool (me: mutable) returns ShapeTool from XCAFDoc;
50 ---Purpose: Returns internal XCAFDoc_ShapeTool tool
51 ---C++: return const &
52
53
54 -- Methods for Material:
55
56 IsMaterial (me; lab: Label from TDF) returns Boolean;
57 ---Purpose: Returns True if label belongs to a material table and
58 -- is a Material definition
59
60 GetMaterialLabels (me; Labels: out LabelSequence from TDF);
61 ---Purpose: Returns a sequence of materials currently stored
62 -- in the material table
63
64 AddMaterial (me; aName : HAsciiString from TCollection;
65 aDescription : HAsciiString from TCollection;
66 aDensity : Real from Standard;
67 aDensName : HAsciiString from TCollection;
68 aDensValType : HAsciiString from TCollection)
69 returns Label from TDF;
70 ---Purpose: Adds a Material definition to a table and returns its label
71
72 SetMaterial (me; L: Label from TDF;
73 MatL: Label from TDF);
74 ---Purpose: Sets a link with GUID
75
76 SetMaterial (me; L: Label from TDF; aName : HAsciiString from TCollection;
77 aDescription : HAsciiString from TCollection;
78 aDensity : Real from Standard;
79 aDensName : HAsciiString from TCollection;
80 aDensValType : HAsciiString from TCollection);
81 ---Purpose: Sets a link with GUID
82 -- Adds a Material as necessary
83
84 GetMaterial (me; MatL: Label from TDF; aName : out HAsciiString from TCollection;
85 aDescription : out HAsciiString from TCollection;
86 aDensity : out Real from Standard;
87 aDensName : out HAsciiString from TCollection;
88 aDensValType : out HAsciiString from TCollection) returns Boolean;
89 ---Purpose: Returns Material assigned to <MatL>
90 -- Returns False if no such Material is assigned
91
92 GetDensityForShape (myclass; ShapeL: Label from TDF) returns Real from Standard;
93 ---Purpose: Find referred material and return density from it
94 -- if no material --> return 0
95
96
97 ID (me)
98 ---C++: return const &
99 returns GUID from Standard;
100
101 Restore (me: mutable; with : Attribute from TDF);
102
103 NewEmpty (me)
6e33d3ce 104 returns Attribute from TDF;
7fd59977 105
6e33d3ce 106 Paste (me; into : Attribute from TDF;
107 RT : RelocationTable from TDF);
7fd59977 108
109fields
110
111 myShapeTool: ShapeTool from XCAFDoc;
112
113end MaterialTool;
114