Sketcher: fix build failures with MSVC

This commit is contained in:
wmayer
2021-12-29 23:46:31 +01:00
committed by wwmayer
parent e8f723b99c
commit 5663651fd0
4 changed files with 15 additions and 20 deletions

View File

@@ -26,12 +26,6 @@
using namespace Sketcher;
const int GeoEnum::RtPnt;
const int GeoEnum::HAxis;
const int GeoEnum::VAxis;
const int GeoEnum::RefExt;
const int GeoEnum::GeoUndef;
bool GeoElementId::operator==(const GeoElementId& obj) const
{
return this->GeoId == obj.GeoId && this->Pos == obj.Pos;

View File

@@ -61,13 +61,13 @@ namespace Sketcher
*
* For Geometry lists, refer to GeoListModel template.
*/
struct SketcherExport GeoEnum
enum GeoEnum
{
static const int RtPnt = -1; // GeoId of the Root Point
static const int HAxis = -1; // GeoId of the Horizontal Axis
static const int VAxis = -2; // GeoId of the Vertical Axis
static const int RefExt = -3; // Starting GeoID of external geometry ( negative geoIds starting at this index)
static const int GeoUndef = -2000; // GeoId of an undefined Geometry (uninitialised or unused GeoId)
RtPnt = -1, // GeoId of the Root Point
HAxis = -1, // GeoId of the Horizontal Axis
VAxis = -2, // GeoId of the Vertical Axis
RefExt = -3, // Starting GeoID of external geometry ( negative geoIds starting at this index)
GeoUndef = -2000, // GeoId of an undefined Geometry (uninitialised or unused GeoId)
};
/*!
@@ -96,7 +96,7 @@ enum class PointPos : int {
* ordered containers.
*
*/
class SketcherExport GeoElementId
class GeoElementId
{
public:
/** @brief default constructor initialises object to an undefined (invalid) element.
@@ -130,13 +130,13 @@ public:
};
// inline constexpr constructor
constexpr GeoElementId::GeoElementId(int geoId, PointPos pos): GeoId(geoId), Pos(pos)
inline constexpr GeoElementId::GeoElementId(int geoId, PointPos pos): GeoId(geoId), Pos(pos)
{
}
constexpr const GeoElementId GeoElementId::RtPnt = GeoElementId(GeoEnum::RtPnt, PointPos::start);
constexpr const GeoElementId GeoElementId::HAxis = GeoElementId(GeoEnum::HAxis, PointPos::none);
constexpr const GeoElementId GeoElementId::VAxis = GeoElementId(GeoEnum::VAxis, PointPos::end);
inline constexpr const GeoElementId GeoElementId::RtPnt = GeoElementId(GeoEnum::RtPnt, PointPos::start);
inline constexpr const GeoElementId GeoElementId::HAxis = GeoElementId(GeoEnum::HAxis, PointPos::none);
inline constexpr const GeoElementId GeoElementId::VAxis = GeoElementId(GeoEnum::VAxis, PointPos::end);
} // namespace Sketcher

View File

@@ -342,7 +342,7 @@ GeoListModel<GeometryFacadeUniquePtr>::GeoListModel(
}
}
template <>
template <> SketcherExport
GeoListModel<std::unique_ptr<const Sketcher::GeometryFacade>>::~GeoListModel()
{
// GeometryFacade is responsible for taken ownership of its pointers and deleting them.
@@ -351,8 +351,8 @@ GeoListModel<std::unique_ptr<const Sketcher::GeometryFacade>>::~GeoListModel()
// instantiate the types so that other translation units can access template constructors
template class GeoListModel<Part::Geometry *>;
template class GeoListModel<std::unique_ptr<const Sketcher::GeometryFacade>>;
template class SketcherExport GeoListModel<Part::Geometry *>;
template class SketcherExport GeoListModel<std::unique_ptr<const Sketcher::GeometryFacade>>;
} // namespace Sketcher

View File

@@ -105,6 +105,7 @@
# include <Gui/InventorAll.h>
#endif
#include <Inventor/SbImage.h>
#include <Inventor/sensors/SoSensor.h>
#include <Inventor/actions/SoGetMatrixAction.h>
#include <Inventor/elements/SoFontNameElement.h>