mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0032907: Coding Rules - eliminate MSVC warning C5054 on VS2019/C++20 (operator &,|: deprecated between enumerations of different types)
operator `&`,`|`: deprecated between enumerations of different types
This commit is contained in:
parent
e9a13cf123
commit
9416ba5fb0
@ -117,22 +117,35 @@ AIS_ViewController::AIS_ViewController()
|
|||||||
myRubberBand->SetDisplayMode (0);
|
myRubberBand->SetDisplayMode (0);
|
||||||
myRubberBand->SetMutable (true);
|
myRubberBand->SetMutable (true);
|
||||||
|
|
||||||
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_RotateOrbit);
|
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton,
|
||||||
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_CTRL, AIS_MouseGesture_Zoom);
|
AIS_MouseGesture_RotateOrbit);
|
||||||
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_SHIFT, AIS_MouseGesture_Pan);
|
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_CTRL,
|
||||||
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT, AIS_MouseGesture_SelectRectangle);
|
AIS_MouseGesture_Zoom);
|
||||||
myMouseGestureMap.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT | Aspect_VKeyFlags_SHIFT, AIS_MouseGesture_SelectRectangle);
|
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
|
||||||
|
AIS_MouseGesture_Pan);
|
||||||
|
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT,
|
||||||
|
AIS_MouseGesture_SelectRectangle);
|
||||||
|
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
|
||||||
|
AIS_MouseGesture_SelectRectangle);
|
||||||
|
|
||||||
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton, AIS_SelectionScheme_Replace);
|
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton,
|
||||||
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT, AIS_SelectionScheme_Replace);
|
AIS_SelectionScheme_Replace);
|
||||||
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_SHIFT, AIS_SelectionScheme_XOR);
|
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT,
|
||||||
myMouseSelectionSchemes.Bind (Aspect_VKeyMouse_LeftButton | Aspect_VKeyFlags_ALT | Aspect_VKeyFlags_SHIFT, AIS_SelectionScheme_XOR);
|
AIS_SelectionScheme_Replace);
|
||||||
|
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
|
||||||
|
AIS_SelectionScheme_XOR);
|
||||||
|
myMouseSelectionSchemes.Bind ((Standard_UInteger )Aspect_VKeyMouse_LeftButton | (Standard_UInteger )Aspect_VKeyFlags_ALT | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
|
||||||
|
AIS_SelectionScheme_XOR);
|
||||||
|
|
||||||
myMouseGestureMap.Bind (Aspect_VKeyMouse_RightButton, AIS_MouseGesture_Zoom);
|
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_RightButton,
|
||||||
myMouseGestureMap.Bind (Aspect_VKeyMouse_RightButton | Aspect_VKeyFlags_CTRL, AIS_MouseGesture_RotateOrbit);
|
AIS_MouseGesture_Zoom);
|
||||||
|
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_RightButton | (Standard_UInteger )Aspect_VKeyFlags_CTRL,
|
||||||
|
AIS_MouseGesture_RotateOrbit);
|
||||||
|
|
||||||
myMouseGestureMap.Bind (Aspect_VKeyMouse_MiddleButton, AIS_MouseGesture_Pan);
|
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_MiddleButton,
|
||||||
myMouseGestureMap.Bind (Aspect_VKeyMouse_MiddleButton | Aspect_VKeyFlags_CTRL, AIS_MouseGesture_Pan);
|
AIS_MouseGesture_Pan);
|
||||||
|
myMouseGestureMap.Bind ((Standard_UInteger )Aspect_VKeyMouse_MiddleButton | (Standard_UInteger )Aspect_VKeyFlags_CTRL,
|
||||||
|
AIS_MouseGesture_Pan);
|
||||||
|
|
||||||
myMouseGestureMapDrag.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Drag);
|
myMouseGestureMapDrag.Bind (Aspect_VKeyMouse_LeftButton, AIS_MouseGesture_Drag);
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ public:
|
|||||||
void Orientation (const Standard_Integer I, const TopAbs_Orientation Or)
|
void Orientation (const Standard_Integer I, const TopAbs_Orientation Or)
|
||||||
{
|
{
|
||||||
myFlags(I) &= ~EMaskOrient;
|
myFlags(I) &= ~EMaskOrient;
|
||||||
myFlags(I) |= (Or & EMaskOrient);
|
myFlags(I) |= ((Standard_Integer)Or & (Standard_Integer)EMaskOrient);
|
||||||
}
|
}
|
||||||
|
|
||||||
TopAbs_Orientation Orientation (const Standard_Integer I) const
|
TopAbs_Orientation Orientation (const Standard_Integer I) const
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Selected() const
|
inline Standard_Boolean HLRBRep_FaceData::Selected() const
|
||||||
{ return (myFlags & FMaskSelected) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskSelected) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Selected
|
//function : Selected
|
||||||
@ -29,8 +29,8 @@ inline Standard_Boolean HLRBRep_FaceData::Selected() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Selected(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Selected(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskSelected;
|
if (B) myFlags |= (Standard_Integer)FMaskSelected;
|
||||||
else myFlags &= ~FMaskSelected;
|
else myFlags &= ~((Standard_Integer)FMaskSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -39,7 +39,7 @@ inline void HLRBRep_FaceData::Selected(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Back() const
|
inline Standard_Boolean HLRBRep_FaceData::Back() const
|
||||||
{ return (myFlags & FMaskBack) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskBack) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Back
|
//function : Back
|
||||||
@ -48,8 +48,8 @@ inline Standard_Boolean HLRBRep_FaceData::Back() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Back(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Back(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskBack;
|
if (B) myFlags |= (Standard_Integer)FMaskBack;
|
||||||
else myFlags &= ~FMaskBack;
|
else myFlags &= ~((Standard_Integer)FMaskBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -58,7 +58,7 @@ inline void HLRBRep_FaceData::Back(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Side() const
|
inline Standard_Boolean HLRBRep_FaceData::Side() const
|
||||||
{ return (myFlags & FMaskSide) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskSide) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Side
|
//function : Side
|
||||||
@ -67,8 +67,8 @@ inline Standard_Boolean HLRBRep_FaceData::Side() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Side(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Side(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskSide;
|
if (B) myFlags |= (Standard_Integer)FMaskSide;
|
||||||
else myFlags &= ~FMaskSide;
|
else myFlags &= ~((Standard_Integer)FMaskSide);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -77,7 +77,7 @@ inline void HLRBRep_FaceData::Side(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Closed() const
|
inline Standard_Boolean HLRBRep_FaceData::Closed() const
|
||||||
{ return (myFlags & FMaskClosed) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskClosed) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Closed
|
//function : Closed
|
||||||
@ -86,8 +86,8 @@ inline Standard_Boolean HLRBRep_FaceData::Closed() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Closed(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Closed(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskClosed;
|
if (B) myFlags |= (Standard_Integer)FMaskClosed;
|
||||||
else myFlags &= ~FMaskClosed;
|
else myFlags &= ~((Standard_Integer)FMaskClosed);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -96,7 +96,7 @@ inline void HLRBRep_FaceData::Closed(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Hiding() const
|
inline Standard_Boolean HLRBRep_FaceData::Hiding() const
|
||||||
{ return (myFlags & FMaskHiding) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskHiding) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Hiding
|
//function : Hiding
|
||||||
@ -105,8 +105,8 @@ inline Standard_Boolean HLRBRep_FaceData::Hiding() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Hiding(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Hiding(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskHiding;
|
if (B) myFlags |= (Standard_Integer)FMaskHiding;
|
||||||
else myFlags &= ~FMaskHiding;
|
else myFlags &= ~((Standard_Integer)FMaskHiding);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -115,7 +115,7 @@ inline void HLRBRep_FaceData::Hiding(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Simple() const
|
inline Standard_Boolean HLRBRep_FaceData::Simple() const
|
||||||
{ return (myFlags & FMaskSimple) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskSimple) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Simple
|
//function : Simple
|
||||||
@ -124,8 +124,8 @@ inline Standard_Boolean HLRBRep_FaceData::Simple() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Simple(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Simple(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskSimple;
|
if (B) myFlags |= (Standard_Integer)FMaskSimple;
|
||||||
else myFlags &= ~FMaskSimple;
|
else myFlags &= ~((Standard_Integer)FMaskSimple);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -134,7 +134,7 @@ inline void HLRBRep_FaceData::Simple(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Cut() const
|
inline Standard_Boolean HLRBRep_FaceData::Cut() const
|
||||||
{ return (myFlags & FMaskCut) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskCut) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Cut
|
//function : Cut
|
||||||
@ -143,8 +143,8 @@ inline Standard_Boolean HLRBRep_FaceData::Cut() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Cut(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Cut(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskCut;
|
if (B) myFlags |= (Standard_Integer)FMaskCut;
|
||||||
else myFlags &= ~FMaskCut;
|
else myFlags &= ~((Standard_Integer)FMaskCut);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -153,7 +153,7 @@ inline void HLRBRep_FaceData::Cut(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::WithOutL() const
|
inline Standard_Boolean HLRBRep_FaceData::WithOutL() const
|
||||||
{ return (myFlags & FMaskWithOutL) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskWithOutL) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : WithOutL
|
//function : WithOutL
|
||||||
@ -162,8 +162,8 @@ inline Standard_Boolean HLRBRep_FaceData::WithOutL() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::WithOutL(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::WithOutL(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskWithOutL;
|
if (B) myFlags |= (Standard_Integer)FMaskWithOutL;
|
||||||
else myFlags &= ~FMaskWithOutL;
|
else myFlags &= ~((Standard_Integer)FMaskWithOutL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -172,7 +172,7 @@ inline void HLRBRep_FaceData::WithOutL(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Plane() const
|
inline Standard_Boolean HLRBRep_FaceData::Plane() const
|
||||||
{ return (myFlags & FMaskPlane) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskPlane) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Plane
|
//function : Plane
|
||||||
@ -181,8 +181,8 @@ inline Standard_Boolean HLRBRep_FaceData::Plane() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Plane(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Plane(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskPlane;
|
if (B) myFlags |= (Standard_Integer)FMaskPlane;
|
||||||
else myFlags &= ~FMaskPlane;
|
else myFlags &= ~((Standard_Integer)FMaskPlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -191,7 +191,7 @@ inline void HLRBRep_FaceData::Plane(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Cylinder() const
|
inline Standard_Boolean HLRBRep_FaceData::Cylinder() const
|
||||||
{ return (myFlags & FMaskCylinder) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskCylinder) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Cylinder
|
//function : Cylinder
|
||||||
@ -200,8 +200,8 @@ inline Standard_Boolean HLRBRep_FaceData::Cylinder() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Cylinder(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Cylinder(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskCylinder;
|
if (B) myFlags |= (Standard_Integer)FMaskCylinder;
|
||||||
else myFlags &= ~FMaskCylinder;
|
else myFlags &= ~((Standard_Integer)FMaskCylinder);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -210,7 +210,7 @@ inline void HLRBRep_FaceData::Cylinder(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Cone() const
|
inline Standard_Boolean HLRBRep_FaceData::Cone() const
|
||||||
{ return (myFlags & FMaskCone) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskCone) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Cone
|
//function : Cone
|
||||||
@ -219,8 +219,8 @@ inline Standard_Boolean HLRBRep_FaceData::Cone() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Cone(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Cone(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskCone;
|
if (B) myFlags |= (Standard_Integer)FMaskCone;
|
||||||
else myFlags &= ~FMaskCone;
|
else myFlags &= ~((Standard_Integer)FMaskCone);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -229,7 +229,7 @@ inline void HLRBRep_FaceData::Cone(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Sphere() const
|
inline Standard_Boolean HLRBRep_FaceData::Sphere() const
|
||||||
{ return (myFlags & FMaskSphere) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskSphere) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Sphere
|
//function : Sphere
|
||||||
@ -238,8 +238,8 @@ inline Standard_Boolean HLRBRep_FaceData::Sphere() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Sphere(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Sphere(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskSphere;
|
if (B) myFlags |= (Standard_Integer)FMaskSphere;
|
||||||
else myFlags &= ~FMaskSphere;
|
else myFlags &= ~((Standard_Integer)FMaskSphere);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -248,7 +248,7 @@ inline void HLRBRep_FaceData::Sphere(const Standard_Boolean B)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline Standard_Boolean HLRBRep_FaceData::Torus() const
|
inline Standard_Boolean HLRBRep_FaceData::Torus() const
|
||||||
{ return (myFlags & FMaskTorus) != 0; }
|
{ return (myFlags & (Standard_Integer)FMaskTorus) != 0; }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Torus
|
//function : Torus
|
||||||
@ -257,8 +257,8 @@ inline Standard_Boolean HLRBRep_FaceData::Torus() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Torus(const Standard_Boolean B)
|
inline void HLRBRep_FaceData::Torus(const Standard_Boolean B)
|
||||||
{
|
{
|
||||||
if (B) myFlags |= FMaskTorus;
|
if (B) myFlags |= (Standard_Integer)FMaskTorus;
|
||||||
else myFlags &= ~FMaskTorus;
|
else myFlags &= ~((Standard_Integer)FMaskTorus);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -283,7 +283,7 @@ inline void HLRBRep_FaceData::Size(const Standard_Real S)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
inline TopAbs_Orientation HLRBRep_FaceData::Orientation() const
|
inline TopAbs_Orientation HLRBRep_FaceData::Orientation() const
|
||||||
{ return ((TopAbs_Orientation)(myFlags & EMaskOrient)); }
|
{ return ((TopAbs_Orientation)(myFlags & (Standard_Integer)EMaskOrient)); }
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Orientation
|
//function : Orientation
|
||||||
@ -292,8 +292,8 @@ inline TopAbs_Orientation HLRBRep_FaceData::Orientation() const
|
|||||||
|
|
||||||
inline void HLRBRep_FaceData::Orientation(const TopAbs_Orientation O)
|
inline void HLRBRep_FaceData::Orientation(const TopAbs_Orientation O)
|
||||||
{
|
{
|
||||||
myFlags &= ~EMaskOrient;
|
myFlags &= ~(Standard_Integer)EMaskOrient;
|
||||||
myFlags |= (O & EMaskOrient);
|
myFlags |= ((Standard_Integer)O & (Standard_Integer)EMaskOrient);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -31,27 +31,27 @@
|
|||||||
*
|
*
|
||||||
* The flags are grouped in semantic groups:
|
* The flags are grouped in semantic groups:
|
||||||
* - No flags means nothing done
|
* - No flags means nothing done
|
||||||
* - Done flags correspond to some operation succesffuly completed
|
* - Done flags correspond to some operation successfully completed
|
||||||
* - Warning flags correspond to warning messages on some
|
* - Warning flags correspond to warning messages on some
|
||||||
* potentially wrong situation, not harming algorithm execution
|
* potentially wrong situation, not harming algorithm execution
|
||||||
* - Alarm flags correspond to more severe warnings about incorrect
|
* - Alarm flags correspond to more severe warnings about incorrect
|
||||||
* user data, while not breaking algorithm execution
|
* user data, while not breaking algorithm execution
|
||||||
* - Fail flags correspond to cases when algorithm failed to complete
|
* - Fail flags correspond to cases when algorithm failed to complete
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class Message_ExecStatus
|
class Message_ExecStatus
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//! Mask to separate bits indicating status type and index within the type
|
//! Mask to separate bits indicating status type and index within the type
|
||||||
enum StatusMask {
|
enum StatusMask
|
||||||
|
{
|
||||||
MType = 0x0000ff00,
|
MType = 0x0000ff00,
|
||||||
MIndex = 0x000000ff
|
MIndex = 0x000000ff
|
||||||
};
|
};
|
||||||
static inline int getBitFlag (int status)
|
|
||||||
|
static inline int getBitFlag (int theStatus)
|
||||||
{
|
{
|
||||||
return 0x1 << (status & MIndex);
|
return 0x1 << (theStatus & MIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -65,49 +65,47 @@ class Message_ExecStatus
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
//! Initialise the execution status
|
//! Initialise the execution status
|
||||||
Message_ExecStatus ( Message_Status status )
|
Message_ExecStatus (Message_Status theStatus)
|
||||||
: myDone (Message_None), myWarn (Message_None),
|
: myDone (Message_None), myWarn (Message_None),
|
||||||
myAlarm (Message_None), myFail (Message_None)
|
myAlarm (Message_None), myFail (Message_None)
|
||||||
{
|
{
|
||||||
Set( status );
|
Set (theStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets a status flag
|
//! Sets a status flag
|
||||||
void Set (Message_Status status)
|
void Set (Message_Status theStatus)
|
||||||
{
|
{
|
||||||
switch( status & MType )
|
switch (TypeOfStatus (theStatus))
|
||||||
{
|
{
|
||||||
case Message_DONE: myDone |= (getBitFlag( status )); break;
|
case Message_DONE: myDone |= (getBitFlag (theStatus)); break;
|
||||||
case Message_WARN: myWarn |= (getBitFlag( status )); break;
|
case Message_WARN: myWarn |= (getBitFlag (theStatus)); break;
|
||||||
case Message_ALARM:myAlarm |= (getBitFlag( status )); break;
|
case Message_ALARM: myAlarm |= (getBitFlag (theStatus)); break;
|
||||||
case Message_FAIL: myFail |= (getBitFlag( status )); break;
|
case Message_FAIL: myFail |= (getBitFlag (theStatus)); break;
|
||||||
default: break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Check status for being set
|
//! Check status for being set
|
||||||
Standard_Boolean IsSet (Message_Status status) const
|
Standard_Boolean IsSet (Message_Status theStatus) const
|
||||||
{
|
{
|
||||||
switch( status & MType )
|
switch (TypeOfStatus (theStatus))
|
||||||
{
|
{
|
||||||
case Message_DONE: return ( myDone & getBitFlag( status ) ? Standard_True : Standard_False );
|
case Message_DONE: return (myDone & getBitFlag (theStatus)) != 0;
|
||||||
case Message_WARN: return ( myWarn & getBitFlag( status ) ? Standard_True : Standard_False );
|
case Message_WARN: return (myWarn & getBitFlag (theStatus)) != 0;
|
||||||
case Message_ALARM:return ( myAlarm & getBitFlag( status ) ? Standard_True : Standard_False );
|
case Message_ALARM: return (myAlarm & getBitFlag (theStatus)) != 0;
|
||||||
case Message_FAIL: return ( myFail & getBitFlag( status ) ? Standard_True : Standard_False );
|
case Message_FAIL: return (myFail & getBitFlag (theStatus)) != 0;
|
||||||
default: return Standard_False;
|
|
||||||
}
|
}
|
||||||
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Clear one status
|
//! Clear one status
|
||||||
void Clear (Message_Status status)
|
void Clear (Message_Status theStatus)
|
||||||
{
|
{
|
||||||
switch( status & MType )
|
switch (TypeOfStatus (theStatus))
|
||||||
{
|
{
|
||||||
case Message_DONE: myDone &= ~(getBitFlag( status )); return;
|
case Message_DONE: myDone &= ~(getBitFlag (theStatus)); return;
|
||||||
case Message_WARN: myWarn &= ~(getBitFlag( status )); return;
|
case Message_WARN: myWarn &= ~(getBitFlag (theStatus)); return;
|
||||||
case Message_ALARM:myAlarm &= ~(getBitFlag( status )); return;
|
case Message_ALARM:myAlarm &= ~(getBitFlag (theStatus)); return;
|
||||||
case Message_FAIL: myFail &= ~(getBitFlag( status )); return;
|
case Message_FAIL: myFail &= ~(getBitFlag (theStatus)); return;
|
||||||
default: return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,29 +177,29 @@ class Message_ExecStatus
|
|||||||
};
|
};
|
||||||
|
|
||||||
//! Returns index of status in whole range [FirstStatus, LastStatus]
|
//! Returns index of status in whole range [FirstStatus, LastStatus]
|
||||||
static Standard_Integer StatusIndex( Message_Status status )
|
static Standard_Integer StatusIndex (Message_Status theStatus)
|
||||||
{
|
{
|
||||||
switch( status & MType )
|
switch (TypeOfStatus (theStatus))
|
||||||
{
|
{
|
||||||
case Message_DONE: return 0 * StatusesPerType + LocalStatusIndex(status);
|
case Message_DONE: return 0 * StatusesPerType + LocalStatusIndex(theStatus);
|
||||||
case Message_WARN: return 1 * StatusesPerType + LocalStatusIndex(status);
|
case Message_WARN: return 1 * StatusesPerType + LocalStatusIndex(theStatus);
|
||||||
case Message_ALARM: return 2 * StatusesPerType + LocalStatusIndex(status);
|
case Message_ALARM: return 2 * StatusesPerType + LocalStatusIndex(theStatus);
|
||||||
case Message_FAIL: return 3 * StatusesPerType + LocalStatusIndex(status);
|
case Message_FAIL: return 3 * StatusesPerType + LocalStatusIndex(theStatus);
|
||||||
default: return 0;
|
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns index of status inside type of status (Done or Warn or, etc)
|
//! Returns index of status inside type of status (Done or Warn or, etc)
|
||||||
//! in range [1, StatusesPerType]
|
//! in range [1, StatusesPerType]
|
||||||
static Standard_Integer LocalStatusIndex( Message_Status status )
|
static Standard_Integer LocalStatusIndex (Message_Status theStatus)
|
||||||
{
|
{
|
||||||
return (status & MIndex) + 1;
|
return ((Standard_UInteger )theStatus & (Standard_UInteger )MIndex) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns status type (DONE, WARN, ALARM, or FAIL)
|
//! Returns status type (DONE, WARN, ALARM, or FAIL)
|
||||||
static Message_StatusType TypeOfStatus( Message_Status status )
|
static Message_StatusType TypeOfStatus (Message_Status theStatus)
|
||||||
{
|
{
|
||||||
return (Message_StatusType)(status & MType);
|
return (Message_StatusType )((Standard_UInteger )theStatus & (Standard_UInteger )MType);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns status with index theIndex in whole range [FirstStatus, LastStatus]
|
//! Returns status with index theIndex in whole range [FirstStatus, LastStatus]
|
||||||
@ -222,7 +220,6 @@ class Message_ExecStatus
|
|||||||
//!@}
|
//!@}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// ---------- PRIVATE FIELDS ----------
|
|
||||||
Standard_Integer myDone;
|
Standard_Integer myDone;
|
||||||
Standard_Integer myWarn;
|
Standard_Integer myWarn;
|
||||||
Standard_Integer myAlarm;
|
Standard_Integer myAlarm;
|
||||||
|
@ -59,6 +59,7 @@
|
|||||||
#include <Standard_Macro.hxx>
|
#include <Standard_Macro.hxx>
|
||||||
|
|
||||||
typedef int Standard_Integer;
|
typedef int Standard_Integer;
|
||||||
|
typedef unsigned int Standard_UInteger;
|
||||||
typedef double Standard_Real;
|
typedef double Standard_Real;
|
||||||
typedef bool Standard_Boolean;
|
typedef bool Standard_Boolean;
|
||||||
typedef float Standard_ShortReal;
|
typedef float Standard_ShortReal;
|
||||||
|
@ -88,27 +88,37 @@ ViewerTest_EventManager::ViewerTest_EventManager (const Handle(V3d_View)&
|
|||||||
{
|
{
|
||||||
myViewAnimation = GlobalViewAnimation();
|
myViewAnimation = GlobalViewAnimation();
|
||||||
|
|
||||||
addActionHotKeys (Aspect_VKey_NavForward, Aspect_VKey_W, Aspect_VKey_W | Aspect_VKeyFlags_SHIFT);
|
addActionHotKeys (Aspect_VKey_NavForward, (Standard_UInteger )Aspect_VKey_W,
|
||||||
addActionHotKeys (Aspect_VKey_NavBackward , Aspect_VKey_S, Aspect_VKey_S | Aspect_VKeyFlags_SHIFT);
|
(Standard_UInteger )Aspect_VKey_W | (Standard_UInteger )Aspect_VKeyFlags_SHIFT);
|
||||||
addActionHotKeys (Aspect_VKey_NavSlideLeft, Aspect_VKey_A, Aspect_VKey_A | Aspect_VKeyFlags_SHIFT);
|
addActionHotKeys (Aspect_VKey_NavBackward , (Standard_UInteger )Aspect_VKey_S,
|
||||||
addActionHotKeys (Aspect_VKey_NavSlideRight, Aspect_VKey_D, Aspect_VKey_D | Aspect_VKeyFlags_SHIFT);
|
(Standard_UInteger )Aspect_VKey_S | (Standard_UInteger )Aspect_VKeyFlags_SHIFT);
|
||||||
addActionHotKeys (Aspect_VKey_NavRollCCW, Aspect_VKey_Q, Aspect_VKey_Q | Aspect_VKeyFlags_SHIFT);
|
addActionHotKeys (Aspect_VKey_NavSlideLeft, (Standard_UInteger )Aspect_VKey_A,
|
||||||
addActionHotKeys (Aspect_VKey_NavRollCW, Aspect_VKey_E, Aspect_VKey_E | Aspect_VKeyFlags_SHIFT);
|
(Standard_UInteger )Aspect_VKey_A | (Standard_UInteger )Aspect_VKeyFlags_SHIFT);
|
||||||
|
addActionHotKeys (Aspect_VKey_NavSlideRight, (Standard_UInteger )Aspect_VKey_D,
|
||||||
|
(Standard_UInteger )Aspect_VKey_D | (Standard_UInteger )Aspect_VKeyFlags_SHIFT);
|
||||||
|
addActionHotKeys (Aspect_VKey_NavRollCCW, (Standard_UInteger )Aspect_VKey_Q,
|
||||||
|
(Standard_UInteger )Aspect_VKey_Q | (Standard_UInteger )Aspect_VKeyFlags_SHIFT);
|
||||||
|
addActionHotKeys (Aspect_VKey_NavRollCW, (Standard_UInteger )Aspect_VKey_E,
|
||||||
|
(Standard_UInteger )Aspect_VKey_E | (Standard_UInteger )Aspect_VKeyFlags_SHIFT);
|
||||||
|
|
||||||
addActionHotKeys (Aspect_VKey_NavSpeedIncrease, Aspect_VKey_Plus, Aspect_VKey_Plus | Aspect_VKeyFlags_SHIFT,
|
addActionHotKeys (Aspect_VKey_NavSpeedIncrease, (Standard_UInteger )Aspect_VKey_Plus,
|
||||||
Aspect_VKey_Equal,
|
(Standard_UInteger )Aspect_VKey_Plus | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
|
||||||
Aspect_VKey_NumpadAdd, Aspect_VKey_NumpadAdd | Aspect_VKeyFlags_SHIFT);
|
(Standard_UInteger )Aspect_VKey_Equal,
|
||||||
addActionHotKeys (Aspect_VKey_NavSpeedDecrease, Aspect_VKey_Minus, Aspect_VKey_Minus | Aspect_VKeyFlags_SHIFT,
|
(Standard_UInteger )Aspect_VKey_NumpadAdd,
|
||||||
Aspect_VKey_NumpadSubtract, Aspect_VKey_NumpadSubtract | Aspect_VKeyFlags_SHIFT);
|
(Standard_UInteger )Aspect_VKey_NumpadAdd | (Standard_UInteger )Aspect_VKeyFlags_SHIFT);
|
||||||
|
addActionHotKeys (Aspect_VKey_NavSpeedDecrease, (Standard_UInteger )Aspect_VKey_Minus,
|
||||||
|
(Standard_UInteger )Aspect_VKey_Minus | (Standard_UInteger )Aspect_VKeyFlags_SHIFT,
|
||||||
|
(Standard_UInteger )Aspect_VKey_NumpadSubtract,
|
||||||
|
(Standard_UInteger )Aspect_VKey_NumpadSubtract | (Standard_UInteger )Aspect_VKeyFlags_SHIFT);
|
||||||
|
|
||||||
addActionHotKeys (Aspect_VKey_NavLookUp, Aspect_VKey_Up);
|
addActionHotKeys (Aspect_VKey_NavLookUp, (Standard_UInteger )Aspect_VKey_Up);
|
||||||
addActionHotKeys (Aspect_VKey_NavLookDown, Aspect_VKey_Down);
|
addActionHotKeys (Aspect_VKey_NavLookDown, (Standard_UInteger )Aspect_VKey_Down);
|
||||||
addActionHotKeys (Aspect_VKey_NavLookLeft, Aspect_VKey_Left);
|
addActionHotKeys (Aspect_VKey_NavLookLeft, (Standard_UInteger )Aspect_VKey_Left);
|
||||||
addActionHotKeys (Aspect_VKey_NavLookRight, Aspect_VKey_Right);
|
addActionHotKeys (Aspect_VKey_NavLookRight, (Standard_UInteger )Aspect_VKey_Right);
|
||||||
addActionHotKeys (Aspect_VKey_NavSlideLeft, Aspect_VKey_Left | Aspect_VKeyFlags_SHIFT);
|
addActionHotKeys (Aspect_VKey_NavSlideLeft, (Standard_UInteger )Aspect_VKey_Left | (Standard_UInteger)Aspect_VKeyFlags_SHIFT);
|
||||||
addActionHotKeys (Aspect_VKey_NavSlideRight, Aspect_VKey_Right | Aspect_VKeyFlags_SHIFT);
|
addActionHotKeys (Aspect_VKey_NavSlideRight, (Standard_UInteger )Aspect_VKey_Right | (Standard_UInteger)Aspect_VKeyFlags_SHIFT);
|
||||||
addActionHotKeys (Aspect_VKey_NavSlideUp, Aspect_VKey_Up | Aspect_VKeyFlags_SHIFT);
|
addActionHotKeys (Aspect_VKey_NavSlideUp, (Standard_UInteger )Aspect_VKey_Up | (Standard_UInteger)Aspect_VKeyFlags_SHIFT);
|
||||||
addActionHotKeys (Aspect_VKey_NavSlideDown, Aspect_VKey_Down | Aspect_VKeyFlags_SHIFT);
|
addActionHotKeys (Aspect_VKey_NavSlideDown, (Standard_UInteger )Aspect_VKey_Down | (Standard_UInteger)Aspect_VKeyFlags_SHIFT);
|
||||||
|
|
||||||
// window could be actually not yet set to the View
|
// window could be actually not yet set to the View
|
||||||
//SetupWindowCallbacks (theView->Window());
|
//SetupWindowCallbacks (theView->Window());
|
||||||
@ -508,11 +518,11 @@ void ViewerTest_EventManager::ProcessKeyPress (Aspect_VKey theKey)
|
|||||||
myCtx->UpdateCurrentViewer();
|
myCtx->UpdateCurrentViewer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Aspect_VKey_S | Aspect_VKeyFlags_CTRL:
|
case (Standard_UInteger)Aspect_VKey_S | (Standard_UInteger)Aspect_VKeyFlags_CTRL:
|
||||||
case Aspect_VKey_W | Aspect_VKeyFlags_CTRL:
|
case (Standard_UInteger)Aspect_VKey_W | (Standard_UInteger)Aspect_VKeyFlags_CTRL:
|
||||||
{
|
{
|
||||||
Standard_Integer aDispMode = AIS_Shaded;
|
Standard_Integer aDispMode = AIS_Shaded;
|
||||||
if (theKey == (Aspect_VKey_S | Aspect_VKeyFlags_CTRL))
|
if (theKey == ((Standard_UInteger)Aspect_VKey_S | (Standard_UInteger)Aspect_VKeyFlags_CTRL))
|
||||||
{
|
{
|
||||||
aDispMode = AIS_Shaded;
|
aDispMode = AIS_Shaded;
|
||||||
std::cout << "setup Shaded display mode\n";
|
std::cout << "setup Shaded display mode\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user