set (OpenCASCADE_WITH_VTK @USE_VTK@)
set (OpenCASCADE_WITH_FFMPEG @USE_FFMPEG@)
set (OpenCASCADE_WITH_GLES2 @USE_GLES2@)
+set (OpenCASCADE_WITH_INSPECTOR @BUILD_Inspector@)
@SET_OpenCASCADE_WITH_D3D@
@SET_OpenCASCADE_WITH_GLX@
// function : Constructor
// purpose :
// =======================================================================
-Standard_DumpSentry::Standard_DumpSentry (Standard_OStream& theOStream, const char*)
+Standard_DumpSentry::Standard_DumpSentry (Standard_OStream& theOStream, const char* className)
: myOStream (&theOStream)
{
- //(*myOStream) << "\"" << theClassName << "\": {";
+ OCCT_DUMP_FIELD_VALUE_STRING (theOStream, className)
+//(*myOStream) << "\"" << theClassName << "\": {";
}
// =======================================================================
aName.Remove (1, 1);
}
- if (::LowerCase (aName.Value(1)) == 'm' && aName.Value (2) == 'y')
+ if (::LowerCase (aName.Value(1)) == 'a' && aName.Value (2) == 'n')
+ {
+ aName.Remove (1, 2);
+ }
+ else if (::LowerCase (aName.Value(1)) == 'a')
+ {
+ aName.Remove (1, 1);
+ }
+ else if (::LowerCase (aName.Value(1)) == 'm' && aName.Value (2) == 'y')
{
aName.Remove (1, 2);
}
return Standard_True;
}
+//=======================================================================
+//function : Display
+//purpose :
+//=======================================================================
+Standard_Boolean ViewerTest::Display (const TCollection_AsciiString& theName,
+ const Handle(AIS_InteractiveObject)& theObject,
+ const Standard_Integer theDispMode,
+ const Standard_Integer theSelectionMode,
+ const Standard_Boolean theToUpdate,
+ const Standard_Boolean theReplaceIfExists)
+{
+ ViewerTest_DoubleMapOfInteractiveAndName& aMap = GetMapOfAIS();
+ Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
+ if (aCtx.IsNull())
+ {
+ std::cout << "Error: AIS context is not available.\n";
+ return Standard_False;
+ }
+
+ if (aMap.IsBound2 (theName))
+ {
+ if (!theReplaceIfExists)
+ {
+ std::cout << "Error: other interactive object has been already registered with name: " << theName << ".\n"
+ << "Please use another name.\n";
+ return Standard_False;
+ }
+
+ if (Handle(AIS_InteractiveObject) anOldObj = aMap.Find2 (theName))
+ {
+ aCtx->Remove (anOldObj, theObject.IsNull() && theToUpdate);
+ }
+ aMap.UnBind2 (theName);
+ }
+
+ if (theObject.IsNull())
+ {
+ // object with specified name has been already unbound
+ return Standard_True;
+ }
+
+ // unbind AIS object if it was bound with another name
+ aMap.UnBind1 (theObject);
+
+ // can be registered without rebinding
+ aMap.Bind (theObject, theName);
+ aCtx->Display (theObject, theDispMode, theSelectionMode, theToUpdate);
+ return Standard_True;
+}
+
//! Alias for ViewerTest::Display(), compatibility with old code.
Standard_EXPORT Standard_Boolean VDisplayAISObject (const TCollection_AsciiString& theName,
const Handle(AIS_InteractiveObject)& theObject,
const Standard_Boolean theToUpdate = Standard_True,
const Standard_Boolean theReplaceIfExists = Standard_True);
+ //! Display AIS object in active Viewer and register it in the map of Interactive Objects with specified name.
+ //! Sets status, display mode and selection mode for the Object
+ //! @param theName key to be associated to displayed interactive object
+ //! @param theObject object to display
+ //! @param theDispMode display mode how the object should be displayed
+ //! @param theSelectionMode if theSelectionMode equals -1, theIObj will not be activated
+ //! @param theToUpdate redraw viewer after displaying object
+ //! @param theReplaceIfExists replace the object assigned to specified key
+ //! @return true if new object has been displayed
+ Standard_EXPORT static Standard_Boolean Display (const TCollection_AsciiString& theName,
+ const Handle(AIS_InteractiveObject)& theObject,
+ const Standard_Integer theDispMode,
+ const Standard_Integer theSelectionMode,
+ const Standard_Boolean theToUpdate = Standard_True,
+ const Standard_Boolean theReplaceIfExists = Standard_True);
+
//! waits until a shape of type <aType> is picked in the AIS Viewer and returns it.
//! if <aType> == TopAbs_Shape, any shape can be picked...
//! MaxPick is the Max number before exiting, if no pick is successful
#include <gp_XYZ.hxx>
#include <Standard_Dump.hxx>
+#include <Standard_WarningsDisable.hxx>
+#include <QApplication>
+#include <QFont>
+#include <Standard_WarningsRestore.hxx>
+
IMPLEMENT_STANDARD_RTTIEXT(TreeModel_ItemProperties, Standard_Transient)
// =======================================================================
return aCachedValues[(int)theRole];
}
- if (theRole != Qt::DisplayRole && theRole != Qt::ToolTipRole)
- return QVariant();
+ if (theRole == Qt::FontRole) // method name is in italic
+ {
+ if (Data(theRow, 0, Qt::DisplayRole).toString().contains("className"))
+ {
+ QFont aFont = qApp->font();
+ aFont.setItalic (true);
+ return aFont;
+ }
+ }
+ if (theRole == Qt::ForegroundRole)
+ {
+ if (Data(theRow, 0, Qt::DisplayRole).toString().contains("className"))
+ return QColor (Qt::darkGray).darker(150);
+ }
- if (theColumn == 0) return RowValues().FindFromIndex (theRow + 1).myKey;
- else if (theColumn == 1) return RowValues().FindFromIndex (theRow + 1).myValue;
+ if (theRole == Qt::DisplayRole || theRole == Qt::ToolTipRole)
+ {
+ if (theColumn == 0) return RowValues().FindFromIndex (theRow + 1).myKey;
+ else if (theColumn == 1) return RowValues().FindFromIndex (theRow + 1).myValue;
+ }
return QVariant();
}
aBVHTree->DumpJson (theOStream);
}
-// =======================================================================
-// function : createChild
-// purpose :
-// =======================================================================
-TreeModel_ItemBasePtr VInspector_ItemBVHTree::createChild (int theRow, int theColumn)
-{
- return VInspector_ItemBVHTreeNode::CreateItem (currentItem(), theRow, theColumn);
-}
-
// =======================================================================
// function : buildPresentationShape
// purpose :
}
return aCompound;*/
}
+
+// =======================================================================
+// function : createChild
+// purpose :
+// =======================================================================
+TreeModel_ItemBasePtr VInspector_ItemBVHTree::createChild (int theRow, int theColumn)
+{
+ return TreeModel_ItemBasePtr();
+}
#include <Standard_ExtString.hxx>
#include <Standard_Version.hxx>
-#define USE_CLIPPLANE
+//#define USE_CLIPPLANE
#ifdef USE_CLIPPLANE
#include <Graphic3d_ClipPlane.hxx>