1
<?xml version="1.0" encoding="UTF-8"?>
2
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd">
7
TwinPointer="AttachEngine"
8
Include="Mod/Part/App/Attacher.h"
9
FatherInclude="Base/BaseClassPy.h"
13
FatherNamespace="Base">
15
<Author Licence="LGPL" Name="DeepSOIC" EMail="vv.titov@gmail.com" />
16
<DeveloperDocu>AttachEngine abstract class</DeveloperDocu>
17
<UserDocu>AttachEngine abstract class - the functionality of AttachableObject, but outside of DocumentObject</UserDocu>
19
<Attribute Name="AttacherType" ReadOnly="true">
21
<UserDocu>Type of engine: 3d, plane, line, or point.</UserDocu>
23
<Parameter Name="AttacherType" Type="String" />
25
<Attribute Name="Mode" ReadOnly="false">
27
<UserDocu>Current attachment mode.</UserDocu>
29
<Parameter Name="Mode" Type="String" />
31
<Attribute Name="References" ReadOnly="false">
33
<UserDocu>Current attachment mode.</UserDocu>
35
<Parameter Name="References" Type="Object" />
37
<Attribute Name="AttachmentOffset" ReadOnly="false">
39
<UserDocu>Current attachment mode.</UserDocu>
41
<Parameter Name="AttachmentOffset" Type="Object" />
43
<Attribute Name="Reverse" ReadOnly="false">
45
<UserDocu>If True, Z axis of attached placement is flipped. X axis is flipped in addition (CS has to remain right-handed).</UserDocu>
47
<Parameter Name="Reverse" Type="Boolean" />
49
<Attribute Name="Parameter" ReadOnly="false">
51
<UserDocu>Value of parameter for some curve attachment modes. Range of 0..1 spans the length of the edge (parameter value can be outside of the range for curves that allow extrapolation.</UserDocu>
53
<Parameter Name="Parameter" Type="Float" />
56
<Attribute Name="CompleteModeList" ReadOnly="true">
58
<UserDocu>List of all attachment modes of all AttachEngines. This is the list of modes in MapMode enum properties of AttachableObjects.</UserDocu>
60
<Parameter Name="CompleteModeList" Type="List" />
62
<Attribute Name="ImplementedModes" ReadOnly="true">
64
<UserDocu>List of all attachment modes of all AttachEngines. This is the list of modes in MapMode enum properties of AttachableObjects.</UserDocu>
66
<Parameter Name="ImplementedModes" Type="List" />
68
<Attribute Name="CompleteRefTypeList" ReadOnly="true">
70
<UserDocu>List of all reference shape types recognized by AttachEngine.</UserDocu>
72
<Parameter Name="CompleteRefTypeList" Type="List" />
75
<Methode Name="getModeInfo">
77
<UserDocu>getModeInfo(mode): returns supported reference combinations, user-friendly name, and so on.</UserDocu>
80
<Methode Name="getRefTypeOfShape">
82
<UserDocu>getRefTypeOfShape(shape): returns shape type as interpreted by AttachEngine. Returns a string.</UserDocu>
85
<Methode Name="isFittingRefType">
87
<UserDocu>isFittingRefType(type_shape, type_needed): tests if shape type, specified by type_shape (string), fits a type required by attachment mode type_needed (string). e.g. 'Circle' fits a requirement of 'Edge', and 'Curve' doesn't fit if a 'Circle' is required.</UserDocu>
90
<Methode Name="downgradeRefType">
92
<UserDocu>downgradeRefType(type): returns next more general type. E.g. downgradeType('Circle') yields 'Curve'.</UserDocu>
95
<Methode Name="getRefTypeInfo">
97
<UserDocu>getRefTypeInfo(type): returns information (dict) on shape type. Keys:'UserFriendlyName', 'TypeIndex', 'Rank'. Rank is the number of times reftype can be downgraded, before it becomes 'Any'.</UserDocu>
100
<Methode Name="copy" Const="true">
102
<UserDocu>copy(): returns a new instance of AttachEngine.</UserDocu>
105
<Methode Name="calculateAttachedPlacement" Const="true">
107
<UserDocu>calculateAttachedPlacement(orig_placement): returns result of attachment, based
108
on current Mode, References, etc. AttachmentOffset is included.
110
original_placement is the previous placement of the object being attached. It
111
is used to preserve orientation for Translate attachment mode. For other modes,
114
Returns the new placement. If not attached, returns None. If attachment fails,
115
an exception is raised.</UserDocu>
118
<Methode Name="suggestModes">
121
<UserDocu>suggestModes(): runs mode suggestion routine and returns a dictionary with
122
results and supplementary information.
125
'allApplicableModes': list of modes that can accept current references. Note
126
that it is only a check by types, and does not guarantee the modes will
129
'bestFitMode': mode that fits current references best. Note that the mode may
130
not be valid for the set of references; check for if 'message' is 'OK'.
132
'error': error message for when 'message' is 'UnexpectedError' or
135
'message': general result of suggestion. 'IncompatibleGeometry', 'NoModesFit':
136
no modes accept current set of references; 'OK': some modes do accept current
137
set of references (though it's not guarantted the modes will work - surrestor
138
only checks for correct types); 'UnexpectedError': should never happen.
140
'nextRefTypeHint': what more can be added to references to reach other modes
141
('reachableModes' provide more extended information on this)
143
'reachableModes': a dict, where key is mode, and value is a list of sequences
144
of references that can be added to fit that mode.
146
'references_Types': a list of types of geometry linked by references (that's
147
the input information for suggestor, actually).</UserDocu>
150
<Methode Name="readParametersFromFeature">
152
<UserDocu>readParametersFromFeature(document_object): sets AttachEngine parameters (References, Mode, etc.) by reading out properties of AttachableObject-derived feature.</UserDocu>
155
<Methode Name="writeParametersToFeature">
158
<UserDocu>writeParametersToFeature(document_object): updates properties of
159
AttachableObject-derived feature with current AttachEngine parameters
160
(References, Mode, etc.).
162
Warning: if a feature linked by AttachEngine.References was deleted, this method
163
will crash FreeCAD.</UserDocu>