wmayer patch for Win & OCC7 compat

This commit is contained in:
WandererFan 2016-05-17 21:44:49 -04:00 committed by wmayer
parent 015c538638
commit 3b96cbbeb6
17 changed files with 59 additions and 59 deletions

View File

@ -28,7 +28,6 @@
# include <stdint.h>
#endif
#include <QColor>
#include <sstream>
#include <iomanip>
@ -52,11 +51,6 @@ public:
*/
Color(uint32_t rgba)
{ setPackedValue( rgba ); }
/**
* creates FC Color from Qt QColor
*/
Color(QColor q)
{ set(q.redF(),q.greenF(),q.blueF()); }
/** Copy constructor. */
Color(const Color& c)
:r(c.r),g(c.g),b(c.b),a(c.a){}
@ -111,17 +105,23 @@ public:
(uint32_t)(a*255.0f + 0.5f));
}
/**
* returns Qt color equivalent to FC color
*
*/
QColor asQColor()
{
return(QColor(int(r*255.0),int(g*255.0),int(b*255.0)));
* creates FC Color from template type, e.g. Qt QColor
*/
template <typename T>
void setValue(const T& q)
{ set(q.redF(),q.greenF(),q.blueF()); }
/**
* returns a template type e.g. Qt color equivalent to FC color
*
*/
template <typename T>
inline T asValue(void) const {
return(T(int(r*255.0),int(g*255.0),int(b*255.0)));
}
/**
* returns color as CSS color "#RRGGBB"
*
*/
* returns color as CSS color "#RRGGBB"
*
*/
std::string asCSSString() {
std::stringstream ss;
ss << "#" << std::hex << std::uppercase << std::setfill('0') << std::setw(2) << int(r*255.0)

View File

@ -60,7 +60,6 @@
#include <Standard_GUID.hxx>
#include <Standard_AbortiveTransaction.hxx>
#include <Standard_Address.hxx>
#include <Standard_AncestorIterator.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Byte.hxx>
#include <Standard_Character.hxx>

View File

@ -51,6 +51,13 @@
#include <bitset>
#include <Mod/Part/App/OpenCascadeAll.h>
#include <BRep_Builder.hxx>
#include <TopoDS_Compound.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <BRepExtrema_DistShapeShape.hxx>
#include <GProp_GProps.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <BRepGProp.hxx>
#include <Python.h>
#elif defined(FC_OS_WIN32)

View File

@ -61,7 +61,6 @@
#include <Standard_GUID.hxx>
#include <Standard_AbortiveTransaction.hxx>
#include <Standard_Address.hxx>
#include <Standard_AncestorIterator.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Byte.hxx>
#include <Standard_Character.hxx>

View File

@ -27,13 +27,11 @@
// OpenCASCADE
#include <Standard_AbortiveTransaction.hxx>
#include <Standard_Address.hxx>
#include <Standard_AncestorIterator.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Byte.hxx>
#include <Standard_Character.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_CString.hxx>
#include <Standard_ctype.hxx>
#include <Standard_ConstructionError.hxx>
#include <Standard_DefineHandle.hxx>
#include <Standard_DimensionError.hxx>
@ -47,9 +45,7 @@
#include <Standard_GUID.hxx>
#include <Standard_ImmutableObject.hxx>
#include <Standard_Integer.hxx>
#include <Standard_InternalType.hxx>
#include <Standard_IStream.hxx>
#include <Standard_KindOfType.hxx>
#include <Standard_LicenseError.hxx>
#include <Standard_LicenseNotFound.hxx>
#include <Standard_Macro.hxx>
@ -62,33 +58,26 @@
#include <Standard_NullObject.hxx>
#include <Standard_NullValue.hxx>
#include <Standard_NumericError.hxx>
#include <Standard_OId.hxx>
#include <Standard_OStream.hxx>
#include <Standard_OutOfMemory.hxx>
#include <Standard_OutOfRange.hxx>
#include <Standard_Overflow.hxx>
#include <Standard_Persistent.hxx>
#include <Standard_Persistent_proto.hxx>
#include <Standard_PrimitiveTypes.hxx>
#include <Standard_ProgramError.hxx>
#include <Standard_RangeError.hxx>
#include <Standard_Real.hxx>
#include <Standard_ShortReal.hxx>
#include <Standard_SStream.hxx>
#include <Standard_Static.hxx>
#include <Standard_Storable.hxx>
#include <Standard_Stream.hxx>
#include <Standard_String.hxx>
#include <Standard_TooManyUsers.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Transient_proto.hxx>
#include <Standard_Type.hxx>
#include <Standard_TypeDef.hxx>
#include <Standard_TypeMismatch.hxx>
#include <Standard_Underflow.hxx>
#include <Standard_UUID.hxx>
#include <Standard_Version.hxx>
#include <Standard_WayOfLife.hxx>
#include <TCollection_ExtendedString.hxx>
#include <TCollection_AsciiString.hxx>

View File

@ -9,6 +9,8 @@ include_directories(
${CMAKE_BINARY_DIR}/src
${CMAKE_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${Boost_INCLUDE_DIRS}
${QT_INCLUDE_DIR}
${OCC_INCLUDE_DIR}

View File

@ -60,12 +60,12 @@
#include <BRepMesh.hxx>
#include <BRepAdaptor_CompCurve.hxx>
#include <Handle_BRepAdaptor_HCompCurve.hxx>
#include <BRepAdaptor_HCompCurve.hxx>
#include <Approx_Curve3d.hxx>
#include <BRepAdaptor_HCurve.hxx>
#include <Handle_BRepAdaptor_HCurve.hxx>
#include <BRepAdaptor_HCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Geom_BSplineCurve.hxx>
#include <Handle_Geom_BSplineCurve.hxx>
#include <Geom_BezierCurve.hxx>
#include <GeomConvert_BSplineCurveToBezierCurve.hxx>
#include <GeomConvert_BSplineCurveKnotSplitting.hxx>

View File

@ -81,12 +81,12 @@
#include <BRepLProp_CurveTool.hxx>
#include <BRepLProp_CLProps.hxx>
// # include <Handle_BRepAdaptor_HCompCurve.hxx>
// # include <BRepAdaptor_HCompCurve.hxx>
# include <Approx_Curve3d.hxx>
# include <BRepAdaptor_HCurve.hxx>
#include <Handle_HLRBRep_Algo.hxx>
#include <Handle_HLRBRep_Data.hxx>
#include <HLRBRep_Algo.hxx>
#include <HLRBRep_Data.hxx>
# include <Geom_BSplineCurve.hxx>
# include <Geom_BezierCurve.hxx>
# include <GeomConvert_BSplineCurveToBezierCurve.hxx>

View File

@ -25,6 +25,7 @@
#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
#include <HLRBRep_Data.hxx>
#include <gp_Pnt.hxx>
#include <Base/Vector3D.h>
@ -34,7 +35,6 @@
#include "Geometry.h"
class HLRBRep_Algo;
class Handle_HLRBRep_Data;
class HLRBRep_EdgeData;
class TopoDS_Wire;
class HLRBRep_HLRToShape;

View File

@ -44,6 +44,10 @@
# pragma warning(disable : 4005)
#endif
#ifdef FC_OS_WIN32
# define NOMINMAX
#endif
#ifdef _PreComp_
// Python

View File

@ -61,14 +61,14 @@ QGIEdge::QGIEdge(int index) :
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("NormalColor", 0x00000000));
m_colNormal = fcColor.asQColor();
m_colNormal = fcColor.asValue<QColor>();
m_defNormal = m_colNormal;
fcColor.setPackedValue(hGrp->GetUnsigned("SelectColor", 0x0000FF00));
m_colSel = fcColor.asQColor();
m_colSel = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("PreSelectColor", 0x00080800));
m_colPre = fcColor.asQColor();
m_colPre = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("HiddenColor", 0x08080800));
m_colHid = fcColor.asQColor();
m_colHid = fcColor.asValue<QColor>();
hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw");
m_styleHid = static_cast<Qt::PenStyle> (hGrp->GetInt("HiddenLine",2));

View File

@ -56,11 +56,11 @@ QGIFace::QGIFace(int ref) :
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("NormalColor", 0x00000000));
m_colNormal = fcColor.asQColor();
m_colNormal = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("SelectColor", 0x0000FF00));
m_colSel = fcColor.asQColor();
m_colSel = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("PreSelectColor", 0x00080800));
m_colPre = fcColor.asQColor();
m_colPre = fcColor.asValue<QColor>();
//m_pen.setStyle(Qt::NoPen);
//m_brush.setStyle(m_fill);

View File

@ -67,11 +67,11 @@ QGIHatch::QGIHatch(std::string parentHatch) :
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("NormalColor", 0x00000000));
m_colNormal = fcColor.asQColor();
m_colNormal = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("SelectColor", 0x0000FF00));
m_colSel = fcColor.asQColor();
m_colSel = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("PreSelectColor", 0x00080800));
m_colPre = fcColor.asQColor();
m_colPre = fcColor.asValue<QColor>();
m_pen.setCosmetic(true);
m_pen.setWidthF(1.);
@ -168,7 +168,7 @@ void QGIHatch::setFill(std::string fillSpec)
void QGIHatch::setColor(App::Color c)
{
m_colNormal = c.asQColor();
m_colNormal = c.asValue<QColor>();
}
void QGIHatch::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) {

View File

@ -54,11 +54,11 @@ QGIVertex::QGIVertex(int index) :
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("NormalColor", 0x00000000));
m_colNormal = fcColor.asQColor();
m_colNormal = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("SelectColor", 0x0000FF00));
m_colSel = fcColor.asQColor();
m_colSel = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("PreSelectColor", 0x00080800));
m_colPre = fcColor.asQColor();
m_colPre = fcColor.asValue<QColor>();
m_brush.setStyle(m_fill);
setPrettyNormal();

View File

@ -75,11 +75,11 @@ QGIView::QGIView(const QPoint &pos, QGraphicsScene *scene)
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("NormalColor", 0x00000000));
m_colNormal = fcColor.asQColor();
m_colNormal = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("SelectColor", 0x0000FF00));
m_colSel = fcColor.asQColor();
m_colSel = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("PreSelectColor", 0x00080800));
m_colPre = fcColor.asQColor();
m_colPre = fcColor.asValue<QColor>();
m_colCurrent = m_colNormal;
m_pen.setColor(m_colCurrent);

View File

@ -91,11 +91,11 @@ QGIDatumLabel::QGIDatumLabel(int ref, QGraphicsScene *scene ) : reference(ref)
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("NormalColor", 0x00000000));
m_colNormal = fcColor.asQColor();
m_colNormal = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("SelectColor", 0x0000FF00));
m_colSel = fcColor.asQColor();
m_colSel = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("PreSelectColor", 0x00080800));
m_colPre = fcColor.asQColor();
m_colPre = fcColor.asValue<QColor>();
}
QVariant QGIDatumLabel::itemChange(GraphicsItemChange change, const QVariant &value)
@ -196,11 +196,11 @@ QGIViewDimension::QGIViewDimension(const QPoint &pos, QGraphicsScene *scene) :
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("NormalColor", 0x00000000));
m_colNormal = fcColor.asQColor();
m_colNormal = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("SelectColor", 0x0000FF00));
m_colSel = fcColor.asQColor();
m_colSel = fcColor.asValue<QColor>();
fcColor.setPackedValue(hGrp->GetUnsigned("PreSelectColor", 0x00080800));
m_colPre = fcColor.asQColor();
m_colPre = fcColor.asValue<QColor>();
addToGroup(arrows);
addToGroup(datumLabel);

View File

@ -71,7 +71,7 @@ QGIViewPart::QGIViewPart(const QPoint &pos, QGraphicsScene *scene)
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Drawing/Colors");
App::Color fcColor = App::Color((uint32_t) hGrp->GetUnsigned("HiddenColor", 0x08080800));
m_colHid = fcColor.asQColor();
m_colHid = fcColor.asValue<QColor>();
}
QGIViewPart::~QGIViewPart()