// =======================================================================
int VInspector_ItemGraphic3dGroup::GetTableRowCount() const
{
- return 40;
+ return 10;
}
// =======================================================================
return QVariant();
bool isFirstColumn = theColumn == 0;
- //switch (theRow)
- //{
- // case 0: return isFirstColumn ? QVariant ("PixelTolerance") : QVariant (myContext->PixelTolerance());
- // case 1: return isFirstColumn ? QVariant ("PickingStrategy") : QVariant (SelectMgr::PickingStrategyToString (myContext->PickingStrategy()));
- // case 2: return isFirstColumn ? QVariant ("AutomaticHilight") : QVariant (myContext->AutomaticHilight());
- // case 3: return isFirstColumn ? QVariant ("ToHilightSelected") : QVariant (myContext->ToHilightSelected());
- // case 4: return isFirstColumn ? QVariant ("AutoActivateSelection") : QVariant (myContext->GetAutoActivateSelection());
- // case 5:
- // case 6:
- // case 7:
- // {
- // AIS_DisplayStatus aDisplayStatus = (AIS_DisplayStatus)(theRow - 5);
- // if (isFirstColumn)
- // return QString ("ObjectsByDisplayStatus: %1").arg (AIS::DisplayStatusToString (aDisplayStatus));
- // AIS_ListOfInteractive anObjects;
- // myContext->ObjectsByDisplayStatus(aDisplayStatus, anObjects);
- // return QVariant (anObjects.Extent());
- // }
- // break;
- // case 8: return isFirstColumn ? QVariant ("DetectedOwner") : QVariant (VInspector_Tools::GetPointerInfo (myContext->DetectedOwner()).ToCString());
- // case 9:
- // {
- // if (isFirstColumn)
- // return QVariant ("DetectedOwners");
- // int aNbOfDetected = 0;
- // for (myContext->InitDetected(); myContext->MoreDetected(); myContext->NextDetected())
- // aNbOfDetected++;
- // return aNbOfDetected;
- // }
- // case 10: return isFirstColumn ? QVariant ("NbSelected") : QVariant (myContext->NbSelected());
- // default: return QVariant();
- //}
+ switch (theRow)
+ {
+ case 0: return isFirstColumn ? QVariant ("LineAspect") : QVariant (ViewControl_Tools::GetPointerInfo (aGroup->LineAspect()).ToCString());
+ case 1: return isFirstColumn ? QVariant ("FillAreaAspect") : QVariant (ViewControl_Tools::GetPointerInfo (aGroup->FillAreaAspect()).ToCString());
+ case 2: return isFirstColumn ? QVariant ("TextAspect") : QVariant (ViewControl_Tools::GetPointerInfo (aGroup->TextAspect()).ToCString());
+ case 3: return isFirstColumn ? QVariant ("MarkerAspect") : QVariant (ViewControl_Tools::GetPointerInfo (aGroup->MarkerAspect()).ToCString());
+ case 4: return isFirstColumn ? QVariant ("ContainsFacet") : QVariant (aGroup->ContainsFacet());
+ case 5: return isFirstColumn ? QVariant ("IsDeleted") : QVariant (aGroup->IsDeleted());
+ case 6: return isFirstColumn ? QVariant ("IsEmpty") : QVariant (aGroup->IsEmpty());
+ case 7: return isFirstColumn ? QVariant ("IsClosed") : QVariant (aGroup->IsClosed());
+ case 8:
+ {
+ if (isFirstColumn)
+ return QVariant ("MinMaxValues");
+ Standard_Real aXMin, anYMin, aZMin, aXMax, anYMax, aZMax;
+ aGroup->MinMaxValues (aXMin, anYMin, aZMin, aXMax, anYMax, aZMax);
+ Bnd_Box aBox;
+ aBox.Update(aXMin, anYMin, aZMin, aXMax, anYMax, aZMax);
+ return QVariant (ViewControl_Tools::ToString (aBox).ToCString());
+ }
+ case 9:
+ {
+ if (isFirstColumn)
+ return QVariant ("BoundingBox");
+ const Graphic3d_BndBox4f& aBndBox = aGroup->BoundingBox();
+ Bnd_Box aBox;
+ aBox.Update((Standard_Real )aBndBox.CornerMin().x(),
+ (Standard_Real )aBndBox.CornerMin().y(),
+ (Standard_Real )aBndBox.CornerMin().z(),
+ (Standard_Real )aBndBox.CornerMax().x(),
+ (Standard_Real )aBndBox.CornerMax().y(),
+ (Standard_Real )aBndBox.CornerMax().z());
+ return QVariant (ViewControl_Tools::ToString (aBox).ToCString());
+ }
+ }
return QVariant();
}
else if (theAspectKind == STANDARD_TYPE (Prs3d_IsoAspect)->Name())
return 1 + getTableRowCount (STANDARD_TYPE (Prs3d_LineAspect)->Name());
else if (theAspectKind == STANDARD_TYPE (Prs3d_LineAspect)->Name())
- return 3; // TODO: add Graphic3d_ShaderProgram
+ return 4; // TODO: add Graphic3d_ShaderProgram
else if (theAspectKind == STANDARD_TYPE (Prs3d_PointAspect)->Name())
return 3; // TODO: add Graphic3d_ShaderProgram, Graphic3d_MarkerImage
else if (theAspectKind == STANDARD_TYPE (Prs3d_TextAspect)->Name())
{
switch (aRow)
{
- case 0: return ViewControl_EditType_Color;
- case 1: return ViewControl_EditType_Combo;
- case 2: return ViewControl_EditType_Double;
+ case 0: return ViewControl_EditType_None;
+ case 1: return ViewControl_EditType_Color;
+ case 2: return ViewControl_EditType_Combo;
+ case 3: return ViewControl_EditType_Double;
default: break;
}
}
}
else if (theAspectKind == STANDARD_TYPE (Prs3d_LineAspect)->Name())
{
- if (aRow == 1)
+ if (aRow == 2)
{
for (int i = 0; i <= Aspect_TOL_USERDEFINED; i++)
aValues.append (Aspect::TypeOfLineToString ((Aspect_TypeOfLine)i));
else if (theAspectKind == STANDARD_TYPE (Prs3d_LineAspect)->Name())
{
if (theRole != Qt::DisplayRole && theRole != Qt::BackgroundRole ||
- (theRole == Qt::BackgroundRole && (isFirstColumn || aRow != 0)))
+ (theRole == Qt::BackgroundRole && (isFirstColumn || aRow != 1)))
return QVariant();
Handle(Prs3d_LineAspect) aCustomAspect = Handle(Prs3d_LineAspect)::DownCast (anAspect);
switch (aRow)
{
- case 0: return getColorData("ColorRGBA", aCustomAspect->Aspect()->ColorRGBA(), isFirstColumn, theRole);
- case 1: return isFirstColumn ? QVariant ("Type")
- : QVariant (Aspect::TypeOfLineToString (aCustomAspect->Aspect()->Type()));
- case 2: return isFirstColumn ? QVariant ("Width") : ViewControl_Tools::ToVariant (aCustomAspect->Aspect()->Width());
+ case 0: return isFirstColumn ? QVariant ("Aspect") :
+ QVariant (ViewControl_Tools::GetPointerInfo (aCustomAspect->Aspect()).ToCString());
+ case 1: return getColorData("ColorRGBA", aCustomAspect->Aspect()->ColorRGBA(), isFirstColumn, theRole);
+ case 2: return isFirstColumn ? QVariant ("Type")
+ : QVariant (Aspect::TypeOfLineToString (aCustomAspect->Aspect()->Type()));
+ case 3: return isFirstColumn ? QVariant ("Width") : ViewControl_Tools::ToVariant (aCustomAspect->Aspect()->Width());
default: break;
}
}
Handle(Graphic3d_AspectLine3d) anAspect = aCustomAspect->Aspect();
switch (aRow)
{
- case 0: anAspect->SetColor (ViewControl_ColorSelector::StringToColor (theValue.toString())); break;
- case 1: anAspect->SetType (Aspect::TypeOfLineFromString (theValue.toString().toStdString().c_str())); break;
- case 2: anAspect->SetWidth (ViewControl_Tools::ToShortRealValue (theValue)); break;
+ case 0: break;
+ case 1: anAspect->SetColor (ViewControl_ColorSelector::StringToColor (theValue.toString())); break;
+ case 2: anAspect->SetType (Aspect::TypeOfLineFromString (theValue.toString().toStdString().c_str())); break;
+ case 3: anAspect->SetWidth (ViewControl_Tools::ToShortRealValue (theValue)); break;
default: break;
}
}