42cf5bc1 |
1 | // Created on: 1999-11-18 |
2 | // Created by: Andrey BETENEV |
3 | // Copyright (c) 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 _STEPConstruct_AP203Context_HeaderFile |
18 | #define _STEPConstruct_AP203Context_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | class StepBasic_Approval; |
25 | class StepBasic_DateAndTime; |
26 | class StepBasic_PersonAndOrganization; |
27 | class StepBasic_SecurityClassificationLevel; |
28 | class StepBasic_PersonAndOrganizationRole; |
29 | class StepBasic_DateTimeRole; |
30 | class StepBasic_ApprovalRole; |
31 | class StepAP203_CcDesignPersonAndOrganizationAssignment; |
32 | class StepAP203_CcDesignSecurityClassification; |
33 | class StepAP203_CcDesignDateAndTimeAssignment; |
34 | class StepAP203_CcDesignApproval; |
35 | class StepBasic_ApprovalPersonOrganization; |
36 | class StepBasic_ApprovalDateTime; |
37 | class StepBasic_ProductCategoryRelationship; |
38 | class StepShape_ShapeDefinitionRepresentation; |
39 | class STEPConstruct_Part; |
40 | class StepRepr_NextAssemblyUsageOccurrence; |
41 | |
42 | |
43 | //! Maintains context specific for AP203 (required data and |
44 | //! management information such as persons, dates, approvals etc.) |
45 | //! It contains static entities (which can be shared), default |
46 | //! values for person and organisation, and also provides |
47 | //! tool for creating management entities around specific part (SDR). |
48 | class STEPConstruct_AP203Context |
49 | { |
50 | public: |
51 | |
52 | DEFINE_STANDARD_ALLOC |
53 | |
54 | |
55 | //! Creates tool and fills constant fields |
56 | Standard_EXPORT STEPConstruct_AP203Context(); |
57 | |
58 | //! Returns default approval entity which |
59 | //! is used when no other data are available |
60 | Standard_EXPORT Handle(StepBasic_Approval) DefaultApproval(); |
61 | |
62 | //! Sets default approval |
63 | Standard_EXPORT void SetDefaultApproval (const Handle(StepBasic_Approval)& app); |
64 | |
65 | //! Returns default date_and_time entity which |
66 | //! is used when no other data are available |
67 | Standard_EXPORT Handle(StepBasic_DateAndTime) DefaultDateAndTime(); |
68 | |
69 | //! Sets default date_and_time entity |
70 | Standard_EXPORT void SetDefaultDateAndTime (const Handle(StepBasic_DateAndTime)& dt); |
71 | |
72 | //! Returns default person_and_organization entity which |
73 | //! is used when no other data are available |
74 | Standard_EXPORT Handle(StepBasic_PersonAndOrganization) DefaultPersonAndOrganization(); |
75 | |
76 | //! Sets default person_and_organization entity |
77 | Standard_EXPORT void SetDefaultPersonAndOrganization (const Handle(StepBasic_PersonAndOrganization)& po); |
78 | |
79 | //! Returns default security_classification_level entity which |
80 | //! is used when no other data are available |
81 | Standard_EXPORT Handle(StepBasic_SecurityClassificationLevel) DefaultSecurityClassificationLevel(); |
82 | |
83 | //! Sets default security_classification_level |
84 | Standard_EXPORT void SetDefaultSecurityClassificationLevel (const Handle(StepBasic_SecurityClassificationLevel)& sc); |
85 | |
86 | Standard_EXPORT Handle(StepBasic_PersonAndOrganizationRole) RoleCreator() const; |
87 | |
88 | Standard_EXPORT Handle(StepBasic_PersonAndOrganizationRole) RoleDesignOwner() const; |
89 | |
90 | Standard_EXPORT Handle(StepBasic_PersonAndOrganizationRole) RoleDesignSupplier() const; |
91 | |
92 | Standard_EXPORT Handle(StepBasic_PersonAndOrganizationRole) RoleClassificationOfficer() const; |
93 | |
94 | Standard_EXPORT Handle(StepBasic_DateTimeRole) RoleCreationDate() const; |
95 | |
96 | Standard_EXPORT Handle(StepBasic_DateTimeRole) RoleClassificationDate() const; |
97 | |
98 | //! Return predefined PersonAndOrganizationRole and DateTimeRole |
99 | //! entities named 'creator', 'design owner', 'design supplier', |
100 | //! 'classification officer', 'creation date', 'classification date', |
101 | //! 'approver' |
102 | Standard_EXPORT Handle(StepBasic_ApprovalRole) RoleApprover() const; |
103 | |
104 | //! Takes SDR (part) which brings all standard data around part |
105 | //! (common for AP203 and AP214) and creates all the additional |
106 | //! entities required for AP203 |
107 | Standard_EXPORT void Init (const Handle(StepShape_ShapeDefinitionRepresentation)& sdr); |
108 | |
109 | //! Takes tool which describes standard data around part |
110 | //! (common for AP203 and AP214) and creates all the additional |
111 | //! entities required for AP203 |
112 | //! |
113 | //! The created entities can be obtained by calls to methods |
114 | //! GetCreator(), GetDesignOwner(), GetDesignSupplier(), |
115 | //! GetClassificationOfficer(), GetSecurity(), GetCreationDate(), |
116 | //! GetClassificationDate(), GetApproval(), |
117 | //! GetApprover(), GetApprovalDateTime(), |
118 | //! GetProductCategoryRelationship() |
119 | Standard_EXPORT void Init (const STEPConstruct_Part& SDRTool); |
120 | |
121 | //! Takes NAUO which describes assembly link to component |
122 | //! and creates the security_classification entity associated to |
123 | //! it as required by the AP203 |
124 | //! |
125 | //! Instantiated (or existing previously) entities concerned |
126 | //! can be obtained by calls to methods |
127 | //! GetClassificationOfficer(), GetSecurity(), |
128 | //! GetClassificationDate(), GetApproval(), |
129 | //! GetApprover(), GetApprovalDateTime() |
130 | //! Takes tool which describes standard data around part |
131 | //! (common for AP203 and AP214) and takes from model (or creates |
132 | //! if missing) all the additional entities required by AP203 |
133 | Standard_EXPORT void Init (const Handle(StepRepr_NextAssemblyUsageOccurrence)& nauo); |
134 | |
135 | Standard_EXPORT Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) GetCreator() const; |
136 | |
137 | Standard_EXPORT Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) GetDesignOwner() const; |
138 | |
139 | Standard_EXPORT Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) GetDesignSupplier() const; |
140 | |
141 | Standard_EXPORT Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) GetClassificationOfficer() const; |
142 | |
143 | Standard_EXPORT Handle(StepAP203_CcDesignSecurityClassification) GetSecurity() const; |
144 | |
145 | Standard_EXPORT Handle(StepAP203_CcDesignDateAndTimeAssignment) GetCreationDate() const; |
146 | |
147 | Standard_EXPORT Handle(StepAP203_CcDesignDateAndTimeAssignment) GetClassificationDate() const; |
148 | |
149 | Standard_EXPORT Handle(StepAP203_CcDesignApproval) GetApproval() const; |
150 | |
151 | Standard_EXPORT Handle(StepBasic_ApprovalPersonOrganization) GetApprover() const; |
152 | |
153 | Standard_EXPORT Handle(StepBasic_ApprovalDateTime) GetApprovalDateTime() const; |
154 | |
155 | //! Return entities (roots) instantiated for the part by method Init |
156 | Standard_EXPORT Handle(StepBasic_ProductCategoryRelationship) GetProductCategoryRelationship() const; |
157 | |
158 | //! Clears all fields describing entities specific to each part |
159 | Standard_EXPORT void Clear(); |
160 | |
161 | //! Initializes constant fields (shared entities) |
162 | Standard_EXPORT void InitRoles(); |
163 | |
164 | //! Initializes all missing data which are required for assembly |
165 | Standard_EXPORT void InitAssembly (const Handle(StepRepr_NextAssemblyUsageOccurrence)& nauo); |
166 | |
167 | //! Initializes ClassificationOfficer and ClassificationDate |
168 | //! entities according to Security entity |
169 | Standard_EXPORT void InitSecurityRequisites(); |
170 | |
171 | //! Initializes Approver and ApprovalDateTime |
172 | //! entities according to Approval entity |
173 | Standard_EXPORT void InitApprovalRequisites(); |
174 | |
175 | |
176 | |
177 | |
178 | protected: |
179 | |
180 | |
181 | |
182 | |
183 | |
184 | private: |
185 | |
186 | |
187 | //! Initializes all missing data which are required for part |
188 | Standard_EXPORT void InitPart (const STEPConstruct_Part& SDRTool); |
189 | |
190 | |
191 | Handle(StepBasic_Approval) defApproval; |
192 | Handle(StepBasic_DateAndTime) defDateAndTime; |
193 | Handle(StepBasic_PersonAndOrganization) defPersonAndOrganization; |
194 | Handle(StepBasic_SecurityClassificationLevel) defSecurityClassificationLevel; |
195 | Handle(StepBasic_PersonAndOrganizationRole) roleCreator; |
196 | Handle(StepBasic_PersonAndOrganizationRole) roleDesignOwner; |
197 | Handle(StepBasic_PersonAndOrganizationRole) roleDesignSupplier; |
198 | Handle(StepBasic_PersonAndOrganizationRole) roleClassificationOfficer; |
199 | Handle(StepBasic_DateTimeRole) roleCreationDate; |
200 | Handle(StepBasic_DateTimeRole) roleClassificationDate; |
201 | Handle(StepBasic_ApprovalRole) roleApprover; |
202 | Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) myCreator; |
203 | Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) myDesignOwner; |
204 | Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) myDesignSupplier; |
205 | Handle(StepAP203_CcDesignPersonAndOrganizationAssignment) myClassificationOfficer; |
206 | Handle(StepAP203_CcDesignSecurityClassification) mySecurity; |
207 | Handle(StepAP203_CcDesignDateAndTimeAssignment) myCreationDate; |
208 | Handle(StepAP203_CcDesignDateAndTimeAssignment) myClassificationDate; |
209 | Handle(StepAP203_CcDesignApproval) myApproval; |
210 | Handle(StepBasic_ApprovalPersonOrganization) myApprover; |
211 | Handle(StepBasic_ApprovalDateTime) myApprovalDateTime; |
212 | Handle(StepBasic_ProductCategoryRelationship) myProductCategoryRelationship; |
213 | |
214 | |
215 | }; |
216 | |
217 | |
218 | |
219 | |
220 | |
221 | |
222 | |
223 | #endif // _STEPConstruct_AP203Context_HeaderFile |