Skip to content

Commit 069e3c6

Browse files
Martin Weismannmartinweismann
authored andcommitted
NC-2499: Allow slicestacks on components-objects
Which is correct according to the slices-extension
1 parent bf43f7a commit 069e3c6

17 files changed

+348
-144
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ project (lib3MF)
88

99
# Define Version
1010
set(LIB3MF_VERSION_MAJOR 1) # increase on every backward-compatibility breaking change of the API
11-
set(LIB3MF_VERSION_MINOR 2) # increase on every backward compatible change of the API
11+
set(LIB3MF_VERSION_MINOR 3) # increase on every backward compatible change of the API
1212
set(LIB3MF_VERSION_MICRO 0) # increase on on every change that does not alter the API
1313

1414
set(CMAKE_INSTALL_BINDIR bin CACHE PATH "directory for installing binary files")

Include/Model/COM/NMR_COMInterface_ModelComponentsObject.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,15 @@ namespace NMR {
8484
LIB3MFMETHOD(IsComponentsObject) (_Out_ BOOL * pbIsComponentsObject);
8585
LIB3MFMETHOD(IsValidObject) (_Out_ BOOL * pbIsValid);
8686

87+
LIB3MFMETHOD(SetSliceStackId)(_In_ DWORD nSliceStackId);
88+
LIB3MFMETHOD(GetSliceStackId)(_Out_ DWORD *pnSliceStackId);
89+
LIB3MFMETHOD(SetSlicesMeshResolution)(_In_ eModelSlicesMeshResolution eSlicesMeshResolution);
90+
LIB3MFMETHOD(GetSlicesMeshResolution)(_Out_ eModelSlicesMeshResolution *peSlicesMeshResolution);
91+
8792
LIB3MFMETHOD(CreateDefaultPropertyHandler) (_Outptr_ ILib3MFDefaultPropertyHandler ** ppPropertyHandler);
8893
LIB3MFMETHOD(CreateDefaultMultiPropertyHandler) (_In_ DWORD nChannel, _Outptr_ ILib3MFDefaultPropertyHandler ** ppPropertyHandler);
8994

90-
CCOMModelComponentsObject();
95+
CCOMModelComponentsObject();
9196

9297
void setResource(_In_ PModelResource pModelResource);
9398
};

Include/Model/COM/NMR_COMInterface_ModelMeshObject.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ namespace NMR {
129129

130130
LIB3MFMETHOD(SetSliceStackId)(_In_ DWORD nSliceStackId);
131131
LIB3MFMETHOD(GetSliceStackId)(_Out_ DWORD *pnSliceStackId);
132-
133132
LIB3MFMETHOD(SetSlicesMeshResolution)(_In_ eModelSlicesMeshResolution eSlicesMeshResolution);
134133
LIB3MFMETHOD(GetSlicesMeshResolution)(_Out_ eModelSlicesMeshResolution *peSlicesMeshResolution);
135134

Include/Model/COM/NMR_COMInterfaces.h

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,35 @@ namespace NMR {
816816
*/
817817
LIB3MFMETHOD(IsValidObject) (_Out_ BOOL * pbIsValid) LIB3MFABSTRACT;
818818

819+
/**
820+
* Link the object to a slice stack
821+
*
822+
* @param[in] nSliceStackId id of the slice stack to link
823+
* @return error code or 0 (success)
824+
*/
825+
LIB3MFMETHOD(SetSliceStackId)(_In_ DWORD nSliceStackId) LIB3MFABSTRACT;
826+
827+
/**
828+
* get the id of the slice stack linked to the object
829+
* @param[out] pnSliceStackId id of the slice stack linked to the object
830+
* @return error code or 0 (success)
831+
*/
832+
LIB3MFMETHOD(GetSliceStackId)(_Out_ DWORD *pnSliceStackId) LIB3MFABSTRACT;
833+
834+
/**
835+
* set the meshresolution of the object
836+
* @param[in] eSlicesMeshResolution meshresolution of this object
837+
* @return error code or 0 (success)
838+
*/
839+
LIB3MFMETHOD(SetSlicesMeshResolution)(_In_ eModelSlicesMeshResolution eSlicesMeshResolution) LIB3MFABSTRACT;
840+
841+
/**
842+
* get the meshresolution of the object
843+
* @param[out] peSlicesMeshResolution meshresolution of this object
844+
* @return error code or 0 (success)
845+
*/
846+
LIB3MFMETHOD(GetSlicesMeshResolution)(_Out_ eModelSlicesMeshResolution *peSlicesMeshResolution) LIB3MFABSTRACT;
847+
819848
/* Property handling */
820849

821850
/**
@@ -1953,35 +1982,6 @@ namespace NMR {
19531982
* @return error code or 0 (success)
19541983
*/
19551984
LIB3MFMETHOD(IsManifoldAndOriented) (_Out_ BOOL * pbIsOrientedAndManifold) LIB3MFABSTRACT;
1956-
1957-
/**
1958-
* Link the mesh object to a slice stack
1959-
*
1960-
* @param[in] nSliceStackId id of the slice stack to link
1961-
* @return error code or 0 (success)
1962-
*/
1963-
LIB3MFMETHOD(SetSliceStackId)(_In_ DWORD nSliceStackId) LIB3MFABSTRACT;
1964-
1965-
/**
1966-
* get the id of the slice stack linked to the mesh object
1967-
* @param[out] pnSliceStackId id of the slice stack linked to the mesh object
1968-
* @return error code or 0 (success)
1969-
*/
1970-
LIB3MFMETHOD(GetSliceStackId)(_Out_ DWORD *pnSliceStackId) LIB3MFABSTRACT;
1971-
1972-
/**
1973-
* set the meshresolution of the mesh object
1974-
* @param[in] eSlicesMeshResolution meshresolution of this mesh object
1975-
* @return error code or 0 (success)
1976-
*/
1977-
LIB3MFMETHOD(SetSlicesMeshResolution)(_In_ eModelSlicesMeshResolution eSlicesMeshResolution) LIB3MFABSTRACT;
1978-
1979-
/**
1980-
* get the meshresolution of the mesh object
1981-
* @param[out] peSlicesMeshResolution meshresolution of this mesh object
1982-
* @return error code or 0 (success)
1983-
*/
1984-
LIB3MFMETHOD(GetSlicesMeshResolution)(_Out_ eModelSlicesMeshResolution *peSlicesMeshResolution) LIB3MFABSTRACT;
19851985
};
19861986

19871987
/**********************************************************************************************************

Include/Model/COM/NMR_DLLInterfaces.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,38 @@ namespace NMR {
20182018
*/
20192019
LIB3MF_DECLSPEC LIB3MFRESULT lib3mf_componentsobject_getcomponentcount(_In_ PLib3MFModelComponentsObject * pComponentsObject, _Out_ DWORD * pComponentCount);
20202020

2021+
/**
2022+
* Link a slicestack to the components object
2023+
*
2024+
* @param[in] pComponentsObject components object to link with the slicestack
2025+
* @param[in] pSliceStack slice stack to link the meshobject to
2026+
*/
2027+
LIB3MF_DECLSPEC LIB3MFRESULT lib3mf_componentsobject_setslicestack(_In_ PLib3MFModelComponentsObject *pComponentsObject, _In_ PLib3MFSliceStack *pSliceStack);
2028+
2029+
/**
2030+
* Get the linked slicestack tof a the components object
2031+
*
2032+
* @param[in] pComponentsObject components object to link with the slicestack
2033+
* @param[out] pSliceStack slice stack to link the meshobject to
2034+
*/
2035+
LIB3MF_DECLSPEC LIB3MFRESULT lib3mf_componentsobject_getslicestackid(_In_ PLib3MFModelComponentsObject *pComponentsObject, _Out_ DWORD *pSliceStackId);
2036+
2037+
/**
2038+
* Set the mesh resolution of a components object that has sliceinformation
2039+
*
2040+
* @param[in] pComponentsObject components object for which the meshresolution is set
2041+
* @param[in] eSlicesMeshResolution mesh resolution of the components object
2042+
*/
2043+
LIB3MF_DECLSPEC LIB3MFRESULT lib3mf_componentsobject_setslicesmeshresolution(_In_ PLib3MFModelComponentsObject *pComponentsObject, _In_ eModelSlicesMeshResolution eSlicesMeshResolution);
2044+
2045+
/**
2046+
* Get the mesh resolution of a components object that has sliceinformation
2047+
*
2048+
* @param[in] pComponentsObject components object for which the meshresolution is queried
2049+
* @param[out] peSlicesMeshResolution mesh resolution of the components object
2050+
*/
2051+
LIB3MF_DECLSPEC LIB3MFRESULT lib3mf_componentsobject_getslicesmeshresolution(_In_ PLib3MFModelComponentsObject *pComponentsObject, _Out_ eModelSlicesMeshResolution *eSlicesMeshResolution);
2052+
20212053
// Build Item
20222054
/**
20232055
* Retrieves the object resource associated to a build item

Include/Model/Classes/NMR_ModelComponentsObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace NMR {
4848
typedef std::shared_ptr <CModel> PModel;
4949

5050
class CModelComponentsObject : public CModelObject {
51-
private:
51+
private:
5252
std::vector<PModelComponent> m_Components;
5353
public:
5454
CModelComponentsObject() = delete;

Include/Model/Classes/NMR_ModelMeshObject.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ namespace NMR {
5151
private:
5252
PMesh m_pMesh;
5353
PModelMeshBeamLatticeAttributes m_pBeamLatticeAttributes;
54-
55-
PPackageResourceID m_pSliceStackId;
56-
eModelSlicesMeshResolution m_eSlicesMeshResolution;
57-
5854
public:
5955
CModelMeshObject() = delete;
6056
CModelMeshObject(_In_ const ModelResourceID sID, _In_ CModel * pModel);
@@ -79,12 +75,6 @@ namespace NMR {
7975
_Ret_notnull_ CModelMeshBeamLatticeAttributes * getBeamLatticeAttributes();
8076
void setBeamLatticeAttributes(_In_ PModelMeshBeamLatticeAttributes pBeamLatticeAttributes);
8177

82-
void setSliceStackId(PPackageResourceID nSliceStackId);
83-
PPackageResourceID getSliceStackId();
84-
85-
void setSlicesMeshResolution(eModelSlicesMeshResolution eMeshResolution);
86-
eModelSlicesMeshResolution slicesMeshResolution() const;
87-
8878
ModelResourceID calculateDefaultPropertyID() const;
8979
};
9080

Include/Model/Classes/NMR_ModelObject.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ namespace NMR {
5454
private:
5555
std::wstring m_sName;
5656
std::wstring m_sPartNumber;
57-
57+
PPackageResourceID m_pSliceStackId;
58+
eModelSlicesMeshResolution m_eSlicesMeshResolution;
5859
private:
5960
PUUID m_UUID;
6061
std::wstring m_sThumbnail;
@@ -93,6 +94,12 @@ namespace NMR {
9394

9495
virtual nfBool isValidForSlices(const NMATRIX3& totalParentMatrix) = 0;
9596

97+
void setSliceStackId(PPackageResourceID nSliceStackId);
98+
PPackageResourceID getSliceStackId();
99+
100+
void setSlicesMeshResolution(eModelSlicesMeshResolution eMeshResolution);
101+
eModelSlicesMeshResolution slicesMeshResolution() const;
102+
96103
// Set/Get Default Property
97104
void setDefaultProperty (_In_ PModelDefaultProperty pModelDefaultProperty);
98105
PModelDefaultProperty getDefaultProperty();

Lib3MF-1.docx

-3.13 KB
Binary file not shown.

Lib3MF-1.pdf

4.45 KB
Binary file not shown.

0 commit comments

Comments
 (0)