0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / IGESData / IGESData_GeneralModule.hxx
1 // Created on: 1993-05-10
2 // Created by: Christian CAILLET
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _IGESData_GeneralModule_HeaderFile
18 #define _IGESData_GeneralModule_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Interface_GeneralModule.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Boolean.hxx>
26 class Standard_Transient;
27 class Interface_EntityIterator;
28 class IGESData_IGESEntity;
29 class Interface_ShareTool;
30 class Interface_Check;
31 class IGESData_DirChecker;
32 class Interface_CopyTool;
33 class TCollection_HAsciiString;
34
35
36 class IGESData_GeneralModule;
37 DEFINE_STANDARD_HANDLE(IGESData_GeneralModule, Interface_GeneralModule)
38
39 //! Definition of General Services adapted to IGES.
40 //! This Services comprise : Shared & Implied Lists, Copy, Check
41 //! They are adapted according to the organisation of IGES
42 //! Entities : Directory Part, Lists of Associativities and
43 //! Properties are specifically processed
44 class IGESData_GeneralModule : public Interface_GeneralModule
45 {
46
47 public:
48
49   
50   //! Fills the list of Entities shared by an IGESEntity <ent>,
51   //! according a Case Number <CN> (formerly computed by CaseNum).
52   //! Considers Properties and Directory Part, and calls
53   //! OwnSharedCase (which is adapted to each Type of Entity)
54   Standard_EXPORT void FillSharedCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE;
55   
56   //! Lists the Entities shared by a given IGESEntity <ent>, from
57   //! its specific parameters : specific for each type
58   Standard_EXPORT virtual void OwnSharedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const = 0;
59   
60   //! Lists the Implied References of <ent>. Here, these are the
61   //! Associativities, plus the Entities defined by OwnSharedCase
62   Standard_EXPORT virtual void ListImpliedCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, Interface_EntityIterator& iter) const Standard_OVERRIDE;
63   
64   //! Specific list of Entities implied by a given IGESEntity <ent>
65   //! (in addition to Associativities). By default, there are none,
66   //! but this method can be redefined as required
67   Standard_EXPORT virtual void OwnImpliedCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, Interface_EntityIterator& iter) const;
68   
69   //! Semantic Checking of an IGESEntity. Performs general Checks,
70   //! which use DirChecker, then call OwnCheck which does a check
71   //! specific for each type of Entity
72   Standard_EXPORT void CheckCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const Standard_OVERRIDE;
73   
74   //! Returns a DirChecker, specific for each type of Entity
75   //! (identified by its Case Number) : this DirChecker defines
76   //! constraints which must be respected by the DirectoryPart
77   Standard_EXPORT virtual IGESData_DirChecker DirChecker (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const = 0;
78   
79   //! Performs Specific Semantic Check for each type of Entity
80   Standard_EXPORT virtual void OwnCheckCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const = 0;
81   
82   //! Specific answer to the question "is Copy properly implemented"
83   //! For IGES, answer is always True
84   Standard_EXPORT virtual Standard_Boolean CanCopy (const Standard_Integer CN, const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
85   
86   //! Specific creation of a new void entity
87   Standard_EXPORT virtual Standard_Boolean NewVoid (const Standard_Integer CN, Handle(Standard_Transient)& entto) const Standard_OVERRIDE = 0;
88   
89   //! Copy ("Deep") from <entfrom> to <entto> (same type)
90   //! by using a CopyTool which provides its working Map.
91   //! For IGESEntities, Copies general data (Directory Part, List of
92   //! Properties) and call OwnCopyCase
93   Standard_EXPORT void CopyCase (const Standard_Integer CN, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, Interface_CopyTool& TC) const Standard_OVERRIDE;
94   
95   //! Copies parameters which are specific of each Type of Entity
96   Standard_EXPORT virtual void OwnCopyCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& entfrom, const Handle(IGESData_IGESEntity)& entto, Interface_CopyTool& TC) const = 0;
97   
98   //! Renewing of Implied References.
99   //! For IGESEntities, Copies general data(List of Associativities)
100   //! and calls OwnRenewCase
101   Standard_EXPORT virtual void RenewImpliedCase (const Standard_Integer CN, const Handle(Standard_Transient)& entfrom, const Handle(Standard_Transient)& entto, const Interface_CopyTool& TC) const Standard_OVERRIDE;
102   
103   //! Renews parameters which are specific of each Type of Entity :
104   //! the provided default does nothing, but this method may be
105   //! redefined as required
106   Standard_EXPORT virtual void OwnRenewCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& entfrom, const Handle(IGESData_IGESEntity)& entto, const Interface_CopyTool& TC) const;
107   
108   //! Prepares an IGES Entity for delete : works on directory part
109   //! then calls OwnDeleteCase
110   //! While dispatch requires to copy the entities, <dispatched> is
111   //! ignored, entities are cleared in any case
112   Standard_EXPORT virtual void WhenDeleteCase (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Standard_Boolean dispatched) const Standard_OVERRIDE;
113   
114   //! Specific preparation for delete, acts on own parameters
115   //! Default does nothing, to be redefined as required
116   Standard_EXPORT virtual void OwnDeleteCase (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const;
117   
118   //! Returns the name of an IGES Entity (its NameValue)
119   //! Can be redefined for an even more specific case ...
120   Standard_EXPORT virtual Handle(TCollection_HAsciiString) Name (const Standard_Integer CN, const Handle(Standard_Transient)& ent, const Interface_ShareTool& shares) const Standard_OVERRIDE;
121
122
123
124
125   DEFINE_STANDARD_RTTIEXT(IGESData_GeneralModule,Interface_GeneralModule)
126
127 protected:
128
129
130
131
132 private:
133
134
135
136
137 };
138
139
140
141
142
143
144
145 #endif // _IGESData_GeneralModule_HeaderFile