mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0029674: Improvements in Inspector tool
- preferences for dock windows geometry, tree view columns and current view projection; - ViewControl package for common functionality between plugins; - processing Location and Orientation for external TopoDS_Shape object - 'F5' key to update content of each plugin - visibility column in tree view (used now only in ShapeView) - properties child item for context (presents tree of current Filters of context)
This commit is contained in:
@@ -70,6 +70,27 @@ Standard_CString TopAbs::ShapeOrientationToString (TopAbs_Orientation theOrienta
|
||||
return TopAbs_Table_PrintOrientation[theOrientation];
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeOrientationFromString
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean TopAbs::ShapeOrientationFromString (const Standard_CString theOrientationString,
|
||||
TopAbs_Orientation& theOrientation)
|
||||
{
|
||||
TCollection_AsciiString aName (theOrientationString);
|
||||
aName.UpperCase();
|
||||
for (Standard_Integer anOrientationIter = 0; anOrientationIter <= TopAbs_EXTERNAL; ++anOrientationIter)
|
||||
{
|
||||
Standard_CString anOrientationName = TopAbs_Table_PrintOrientation[anOrientationIter];
|
||||
if (aName == anOrientationName)
|
||||
{
|
||||
theOrientation = TopAbs_Orientation(anOrientationIter);
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TopAbs_Compose
|
||||
//purpose : Compose two orientations
|
||||
|
@@ -141,6 +141,22 @@ public:
|
||||
//! @return string identifier from the list FORWARD, REVERSED, INTERNAL, EXTERNAL
|
||||
Standard_EXPORT static Standard_CString ShapeOrientationToString (TopAbs_Orientation theOrientation);
|
||||
|
||||
//! Returns the shape orientation from the given string identifier (using case-insensitive comparison).
|
||||
//! @param theOrientationString string identifier
|
||||
//! @return shape orientation or TopAbs_FORWARD if string identifier is invalid
|
||||
static TopAbs_Orientation ShapeOrientationFromString (const Standard_CString theOrientationString)
|
||||
{
|
||||
TopAbs_Orientation aType = TopAbs_FORWARD;
|
||||
ShapeOrientationFromString (theOrientationString, aType);
|
||||
return aType;
|
||||
}
|
||||
|
||||
//! Determines the shape orientation from the given string identifier (using case-insensitive comparison).
|
||||
//! @param theOrientationString string identifier
|
||||
//! @param theOrientation detected shape orientation
|
||||
//! @return TRUE if string identifier is known
|
||||
Standard_EXPORT static Standard_Boolean ShapeOrientationFromString (const Standard_CString theOrientationString,
|
||||
TopAbs_Orientation& theOrientation);
|
||||
};
|
||||
|
||||
#endif // _TopAbs_HeaderFile
|
||||
|
@@ -26,6 +26,17 @@
|
||||
#include <V3d_View.hxx>
|
||||
#include <V3d_Viewer.hxx>
|
||||
|
||||
namespace
|
||||
{
|
||||
static Standard_CString V3d_Table_PrintTypeOfOrientation[26] =
|
||||
{
|
||||
"XPOS", "YPOS", "ZPOS", "XNEG", "YNEG", "ZNEG", "XPOSYPOS", "XPOSZPOS", "XPOSZPOS", "XNEGYNEG",
|
||||
"XNEGYPOS", "XNEGZNEG", "XNEGZPOS", "YNEGZNEG", "YNEGZPOS", "XPOSYNEG", "XPOSZNEG", "YPOSZNEG",
|
||||
"XPOSYPOSZPOS", "XPOSYNEGZPOS", "XPOSYPOSZNEG", "XNEGYPOSZPOS", "XPOSYNEGZNEG", "XNEGYPOSZNEG",
|
||||
"XNEGYNEGZPOS", "XNEGYNEGZNEG"
|
||||
};
|
||||
}
|
||||
|
||||
void V3d::ArrowOfRadius(const Handle(Graphic3d_Group)& garrow,const Standard_Real X0,const Standard_Real Y0,const Standard_Real Z0,const Standard_Real Dx,const Standard_Real Dy,const Standard_Real Dz,const Standard_Real Alpha,const Standard_Real Lng)
|
||||
{
|
||||
Standard_Real Xc, Yc, Zc, Xi, Yi, Zi, Xj, Yj, Zj;
|
||||
@@ -134,3 +145,33 @@ void V3d::SwitchViewsinWindow(const Handle(V3d_View)& aPreviousView,
|
||||
aNextView->Viewer()->SetViewOn(aNextView);
|
||||
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TypeOfOrientationToString
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_CString V3d::TypeOfOrientationToString (V3d_TypeOfOrientation theType)
|
||||
{
|
||||
return V3d_Table_PrintTypeOfOrientation[theType];
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TypeOfOrientationFromString
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean V3d::TypeOfOrientationFromString (Standard_CString theTypeString,
|
||||
V3d_TypeOfOrientation& theType)
|
||||
{
|
||||
TCollection_AsciiString aName (theTypeString);
|
||||
aName.UpperCase();
|
||||
for (Standard_Integer aTypeIter = 0; aTypeIter <= V3d_XnegYnegZneg; ++aTypeIter)
|
||||
{
|
||||
Standard_CString aTypeName = V3d_Table_PrintTypeOfOrientation[aTypeIter];
|
||||
if (aName == aTypeName)
|
||||
{
|
||||
theType = V3d_TypeOfOrientation (aTypeIter);
|
||||
return Standard_True;
|
||||
}
|
||||
}
|
||||
return Standard_False;
|
||||
}
|
||||
|
@@ -93,6 +93,28 @@ public:
|
||||
|
||||
Standard_EXPORT static void SwitchViewsinWindow (const Handle(V3d_View)& aPreviousView, const Handle(V3d_View)& aNextView);
|
||||
|
||||
//! Returns the string name for a given orientation type.
|
||||
//! @param theType orientation type
|
||||
//! @return string identifier from the list Xpos, Ypos, Zpos and others
|
||||
Standard_EXPORT static Standard_CString TypeOfOrientationToString (V3d_TypeOfOrientation theType);
|
||||
|
||||
//! Returns the orientation type from the given string identifier (using case-insensitive comparison).
|
||||
//! @param theTypeString string identifier
|
||||
//! @return orientation type or V3d_TypeOfOrientation if string identifier is invalid
|
||||
static V3d_TypeOfOrientation TypeOfOrientationFromString (Standard_CString theTypeString)
|
||||
{
|
||||
V3d_TypeOfOrientation aType = V3d_Xpos;
|
||||
TypeOfOrientationFromString (theTypeString, aType);
|
||||
return aType;
|
||||
}
|
||||
|
||||
//! Determines the shape type from the given string identifier (using case-insensitive comparison).
|
||||
//! @param theTypeString string identifier
|
||||
//! @param theType detected shape type
|
||||
//! @return TRUE if string identifier is known
|
||||
Standard_EXPORT static Standard_Boolean TypeOfOrientationFromString (const Standard_CString theTypeString,
|
||||
V3d_TypeOfOrientation& theType);
|
||||
|
||||
};
|
||||
|
||||
#endif // _V3d_HeaderFile
|
||||
|
Reference in New Issue
Block a user