mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028954: Visualization - implement interactive object for camera manipulations
Added new class AIS_ViewCube implementing interactive cube displaying orientation of the main axes of the model space in the viewer. Each side, edge, or corner of the cube corresponds to particular orientation of the camera, and the class provides methods to move the camera to corresponding position (with animation if needed). DRAW command vviewcube is added to use the cube in DRAW.
This commit is contained in:
2104
src/AIS/AIS_ViewCube.cxx
Normal file
2104
src/AIS/AIS_ViewCube.cxx
Normal file
File diff suppressed because it is too large
Load Diff
1059
src/AIS/AIS_ViewCube.hxx
Normal file
1059
src/AIS/AIS_ViewCube.hxx
Normal file
File diff suppressed because it is too large
Load Diff
@@ -174,3 +174,5 @@ AIS_TypeOfAxis.hxx
|
||||
AIS_TypeOfDist.hxx
|
||||
AIS_TypeOfIso.hxx
|
||||
AIS_TypeOfPlane.hxx
|
||||
AIS_ViewCube.hxx
|
||||
AIS_ViewCube.cxx
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <AIS_ListOfInteractive.hxx>
|
||||
#include <AIS_ListIteratorOfListOfInteractive.hxx>
|
||||
#include <AIS_ViewCube.hxx>
|
||||
#include <Aspect_Grid.hxx>
|
||||
#include <DBRep.hxx>
|
||||
#include <Draw_ProgressIndicator.hxx>
|
||||
@@ -287,6 +288,25 @@ Standard_EXPORT Handle(AIS_Manipulator) GetActiveAISManipulator()
|
||||
return NULL;
|
||||
}
|
||||
|
||||
typedef NCollection_DataMap<Handle(V3d_View), Handle(AIS_ViewCube)> ViewerTest_MapOfViewCube;
|
||||
|
||||
Standard_EXPORT ViewerTest_MapOfViewCube& MapOfViewCube()
|
||||
{
|
||||
static ViewerTest_MapOfViewCube aViewMap;
|
||||
return aViewMap;
|
||||
}
|
||||
|
||||
Standard_EXPORT Handle(AIS_ViewCube) ActiveViewCube()
|
||||
{
|
||||
Handle(AIS_ViewCube) aCube;
|
||||
if (MapOfViewCube().Find (ViewerTest::CurrentView(), aCube))
|
||||
{
|
||||
return aCube;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -12345,6 +12365,215 @@ static int VDumpSelectionImage (Draw_Interpretor& /*theDi*/,
|
||||
return 0;
|
||||
}
|
||||
|
||||
//===============================================================================================
|
||||
//function : VViewCube
|
||||
//purpose :
|
||||
//===============================================================================================
|
||||
static int VViewCube (Draw_Interpretor& theDi,
|
||||
Standard_Integer theArgsNb,
|
||||
const char** theArgVec)
|
||||
{
|
||||
if (theArgsNb < 2)
|
||||
{
|
||||
std::cout << "Syntax error: wrong number arguments for '" << theArgVec[0] << "'\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
const Handle(AIS_InteractiveContext)& aContext = ViewerTest::GetAISContext();
|
||||
const Handle(V3d_View)& aView = ViewerTest::CurrentView();
|
||||
if (aContext.IsNull() || aView.IsNull())
|
||||
{
|
||||
std::cout << "Error: no active view.\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
ViewerTest_AutoUpdater anUpdateTool (aContext, aView);
|
||||
Standard_Integer anArgIter = 1;
|
||||
for (; anArgIter < theArgsNb; ++anArgIter)
|
||||
{
|
||||
anUpdateTool.parseRedrawMode (theArgVec[anArgIter]);
|
||||
}
|
||||
|
||||
Handle(AIS_ViewCube) aViewCube;
|
||||
ViewerTest_CmdParser aCmd;
|
||||
aCmd.AddDescription ("vviewcube Name [options]. Commmand manages View Cube object:");
|
||||
aCmd.AddOption ("enable", "enables view cube");
|
||||
aCmd.AddOption ("disable", "disables view cube");
|
||||
aCmd.AddOption ("remove", "removes view cube presentation from context and view");
|
||||
aCmd.AddOption ("remove", "removes view cube presentation from context and view");
|
||||
aCmd.AddOption ("reset", "reset geomertical and visual attributes");
|
||||
aCmd.AddOption ("size", "... size - set size of View Cube");
|
||||
aCmd.AddOption ("adaptsize", " - adapt all another parameters to input size");
|
||||
aCmd.AddOption ("color", "... r g b - set color of View Cube ");
|
||||
aCmd.AddOption ("boxcolor", "... r g b - set box color of view cube");
|
||||
aCmd.AddOption ("arrowcolor", "... r g b - set arrow color of view cube");
|
||||
aCmd.AddOption ("textcolor", "... r g b - set side text color of view cube");
|
||||
aCmd.AddOption ("innercolor", "... r g b - set inner box color of view cube");
|
||||
aCmd.AddOption ("arrowangle", "... value - set pointer angle of arrows in radians");
|
||||
aCmd.AddOption ("arrowlength", "... value - set length of arrows");
|
||||
aCmd.AddOption ("arrowpadding", "... value - set padding between axis and arrows");
|
||||
aCmd.AddOption ("transparency", "... [0;1] - set transparency of object");
|
||||
aCmd.AddOption ("boxtransparency", "... [0;1] - set transparency of box in View Cube");
|
||||
aCmd.AddOption ("arrowtransparency", "... [0;1] - set transparency of arrows in View Cube");
|
||||
aCmd.AddOption ("font", "... string - set font name");
|
||||
aCmd.AddOption ("fontheight", "... value - set font height");
|
||||
aCmd.AddOption ("boxpadding", "... value - set padding between box sides");
|
||||
aCmd.AddOption ("axispadding", "... value - set padding between box and arrows");
|
||||
aCmd.AddOption ("cornerradius", "... value - set radius of side corners in [0;0.5] (0-50% of box side size)");
|
||||
aCmd.AddOption ("hideedges", " - hide edges of View Cube");
|
||||
aCmd.AddOption ("showedges", " - show edges of View Cube");
|
||||
aCmd.AddOption ("hidevertices", " - hide vertices ov View Cube");
|
||||
aCmd.AddOption ("showvertices", " - show vertices ov View Cube");
|
||||
aCmd.AddOption ("position", "... PixX PixY - 2D position of View Cube from top left corner");
|
||||
|
||||
aCmd.Parse (theArgsNb, theArgVec);
|
||||
|
||||
if (aCmd.HasOption ("help"))
|
||||
{
|
||||
theDi.PrintHelp (theArgVec[0]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get current view cube entity
|
||||
aViewCube = ActiveViewCube();
|
||||
if (aViewCube.IsNull())
|
||||
{
|
||||
aViewCube = new AIS_ViewCube();
|
||||
MapOfViewCube().Bind (aView, aViewCube);
|
||||
aViewCube->SetAutoTransform (Standard_True);
|
||||
}
|
||||
|
||||
if (aCmd.HasOption ("color"))
|
||||
{
|
||||
aViewCube->SetColor (Quantity_Color (aCmd.ArgVec3f ("color")));
|
||||
}
|
||||
if (aCmd.HasOption ("boxcolor"))
|
||||
{
|
||||
aViewCube->SetBoxColor (Quantity_Color (aCmd.ArgVec3f ("boxcolor")));
|
||||
}
|
||||
if (aCmd.HasOption ("arrowcolor"))
|
||||
{
|
||||
aViewCube->SetArrowColor (Quantity_Color (aCmd.ArgVec3f ("arrowcolor")));
|
||||
}
|
||||
if (aCmd.HasOption ("textcolor"))
|
||||
{
|
||||
aViewCube->SetTextColor (Quantity_Color (aCmd.ArgVec3f ("textcolor")));
|
||||
}
|
||||
if (aCmd.HasOption ("innercolor"))
|
||||
{
|
||||
aViewCube->SetInnerColor (Quantity_Color (aCmd.ArgVec3f ("innercolor")));
|
||||
}
|
||||
if (aCmd.HasOption ("arrowangle"))
|
||||
{
|
||||
aViewCube->SetArrowAngle (aCmd.ArgDouble ("arrowangle") * M_PI / 180.0);
|
||||
}
|
||||
if (aCmd.HasOption ("arrowlength"))
|
||||
{
|
||||
aViewCube->SetArrowLength (aCmd.ArgDouble ("arrowlength"));
|
||||
}
|
||||
if (aCmd.HasOption ("arrowpadding"))
|
||||
{
|
||||
aViewCube->SetArrowPadding (aCmd.ArgDouble ("arrowpadding"));
|
||||
}
|
||||
if (aCmd.HasOption ("transparency"))
|
||||
{
|
||||
aViewCube->SetTransparency (aCmd.ArgDouble ("transparency"));
|
||||
}
|
||||
if (aCmd.HasOption ("boxtransparency"))
|
||||
{
|
||||
aViewCube->SetBoxTransparency (aCmd.ArgDouble ("boxtransparency"));
|
||||
}
|
||||
if (aCmd.HasOption ("arrowtransparency"))
|
||||
{
|
||||
aViewCube->SetArrowTransparency (aCmd.ArgDouble ("arrowtransparency"));
|
||||
}
|
||||
if (aCmd.HasOption ("font"))
|
||||
{
|
||||
aViewCube->SetFont (aCmd.Arg ("font", 0).c_str());
|
||||
}
|
||||
if (aCmd.HasOption ("fontheight"))
|
||||
{
|
||||
aViewCube->SetFontHeight (aCmd.ArgDouble ("fontheight", 0));
|
||||
}
|
||||
if (aCmd.HasOption ("boxpadding"))
|
||||
{
|
||||
aViewCube->SetBoxPadding (aCmd.ArgDouble ("boxpadding"));
|
||||
}
|
||||
if (aCmd.HasOption ("axispadding"))
|
||||
{
|
||||
aViewCube->SetAxisPadding (aCmd.ArgDouble ("axispadding"));
|
||||
}
|
||||
if (aCmd.HasOption ("cornerradius"))
|
||||
{
|
||||
aViewCube->SetCornerRadius (aCmd.ArgDouble ("cornerradius"));
|
||||
}
|
||||
if (aCmd.HasOption ("hideedges"))
|
||||
{
|
||||
aViewCube->SetDrawEdges (Standard_False);
|
||||
}
|
||||
if (aCmd.HasOption ("showedges"))
|
||||
{
|
||||
aViewCube->SetDrawEdges (Standard_True);
|
||||
}
|
||||
if (aCmd.HasOption ("hidevertices"))
|
||||
{
|
||||
aViewCube->SetDrawVertices (Standard_False);
|
||||
}
|
||||
if (aCmd.HasOption ("showvertices"))
|
||||
{
|
||||
aViewCube->SetDrawVertices (Standard_True);
|
||||
}
|
||||
if (aCmd.HasOption ("position", 2))
|
||||
{
|
||||
aViewCube->SetPosition (Graphic3d_Vec2i (aCmd.ArgInt ("position", 0), aCmd.ArgInt ("position", 1)),
|
||||
aView);
|
||||
}
|
||||
if (aCmd.HasOption ("size"))
|
||||
{
|
||||
aViewCube->SetSize (aCmd.ArgDouble ("size", 0), aCmd.HasOption ("adaptsize"));
|
||||
}
|
||||
if (aCmd.HasOption ("reset"))
|
||||
{
|
||||
aViewCube->Reset();
|
||||
}
|
||||
|
||||
// Enable View Cube for current view
|
||||
if (aCmd.HasOption ("enable") && !aContext->IsDisplayed (aViewCube))
|
||||
{
|
||||
aContext->MainSelector()->SetPickClosest (Standard_False);
|
||||
if (aViewCube->View().IsNull())
|
||||
{
|
||||
aViewCube->SetView (aView);
|
||||
aViewCube->AddTo (aContext, aView);
|
||||
}
|
||||
else
|
||||
{
|
||||
aViewCube->Show();
|
||||
}
|
||||
}
|
||||
else if (aCmd.HasOption ("disable") && aContext->IsDisplayed (aViewCube))
|
||||
{
|
||||
ViewerTest::GetAISContext()->MainSelector()->SetPickClosest (Standard_True);
|
||||
aViewCube->Hide();
|
||||
}
|
||||
else if (aCmd.HasOption ("remove") && aContext->IsDisplayed (aViewCube))
|
||||
{
|
||||
ViewerTest::GetAISContext()->MainSelector()->SetPickClosest (Standard_True);
|
||||
MapOfViewCube().UnBind (aViewCube->View());
|
||||
aContext->Remove (aViewCube, Standard_False);
|
||||
}
|
||||
else
|
||||
{
|
||||
TColStd_ListOfInteger aModes;
|
||||
aViewCube->ToBeUpdated (aModes);
|
||||
if (!aModes.IsEmpty())
|
||||
{
|
||||
aContext->Redisplay (aViewCube, Standard_False);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ViewerCommands
|
||||
//purpose :
|
||||
@@ -13063,4 +13292,39 @@ void ViewerTest::ViewerCommands(Draw_Interpretor& theCommands)
|
||||
"vprogressive",
|
||||
__FILE__, VProgressiveMode, group);
|
||||
#endif
|
||||
|
||||
theCommands.Add ("vviewcube",
|
||||
"\n vviewcube [-enable|-disable]"
|
||||
"\n Warning: after end pf test please call vviewcube -remove, otherwise View Cube will hold down active view from closing"
|
||||
"\n tool to create and manage interactive view manipualtion object for active view."
|
||||
"\n Options: "
|
||||
"\n '-enable|disable' display/erase view cube with defined visual options"
|
||||
"\n '-reset reset geomertical and visual attributes'"
|
||||
"\n '-size Value' adjust position when attaching"
|
||||
"\n '-adaptSize' call with -size to adapt all part to size of 3D box"
|
||||
"\n 'remove' removes view cube presentation from context and view"
|
||||
"\n 'size Size' set size of View Cube"
|
||||
"\n 'color R G B' set color of View Cube in limits [0;1]"
|
||||
"\n 'boxcolor R G B' set box color of view cube in limits [0;1]"
|
||||
"\n 'arrowcolor R G B' set arrow color of view cube in limits [0;1]"
|
||||
"\n 'textcolor R G B' set color of side text of view cube in limits [0;1]"
|
||||
"\n 'innercolor R G B' set inner box color of view cube in limits [0;1]"
|
||||
"\n 'arrowangle Value' set pointer angle of arrows in radians"
|
||||
"\n 'arrowlength Value' set length of arrows"
|
||||
"\n 'arrowpadding Value' set padding between axis and arrows"
|
||||
"\n 'transparency [0;1]' set transparency of object"
|
||||
"\n 'boxtransparency [0;1]' set transparency of box in View Cube"
|
||||
"\n 'arrowtransparency [0;1]' set transparency of arrows in View Cube"
|
||||
"\n 'font Name' set font name"
|
||||
"\n 'fontheight value' set font height"
|
||||
"\n 'boxpadding Value' set padding between box sides"
|
||||
"\n 'axispadding Value' set padding between box and arrows"
|
||||
"\n 'cornerradius Value' set radius of corners of sides"
|
||||
"\n 'hideedges' hide edges of View Cube"
|
||||
"\n 'showedges' show edges of View Cube"
|
||||
"\n 'hidevertices' hide vertices ov View Cube"
|
||||
"\n 'showvertices' show vertices ov View Cube"
|
||||
"\n 'position XPix YPix' 2D position of View Cube from top left corner",
|
||||
__FILE__, VViewCube, group);
|
||||
|
||||
}
|
||||
|
64
tests/v3d/viewcube/default
Normal file
64
tests/v3d/viewcube/default
Normal file
@@ -0,0 +1,64 @@
|
||||
puts "=================================="
|
||||
puts "AIS_ViewCube - display and erase with default settings"
|
||||
puts "=================================="
|
||||
|
||||
set anImage1 $imagedir/${casename}_1.png
|
||||
set anImage2 $imagedir/${casename}_2.png
|
||||
set anImage3 $imagedir/${casename}_3.png
|
||||
set anImage4 $imagedir/${casename}_4.png
|
||||
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit
|
||||
# -------------------------------------
|
||||
# create helper object
|
||||
# -------------------------------------
|
||||
box aBox1 15 20 70
|
||||
vdisplay aBox1 -dispMode 1
|
||||
vaxo
|
||||
vfit
|
||||
|
||||
# -------------------------------------
|
||||
# display view cube object
|
||||
# -------------------------------------
|
||||
vviewcube -enable -size 70 -adaptsize -position 120 250
|
||||
|
||||
vmoveto 118 230
|
||||
if {[vreadpixel 118 230 name] != "DARKTURQUOISE 1"} {
|
||||
puts "ERROR: Highlighting of view cube side is wrong."
|
||||
}
|
||||
vmoveto 0 0
|
||||
vdump $anImage1
|
||||
|
||||
# -------------------------------------
|
||||
# Check side
|
||||
# -------------------------------------
|
||||
vselect 125 200
|
||||
if {[vreadpixel 115 233 name] != "GRAY95 1"} {
|
||||
puts "ERROR: Display of view cube is wrong."
|
||||
}
|
||||
if {[vreadpixel 190 136 name] != "IVORY 1"} {
|
||||
puts "ERROR: Position of TOP camera is wrong."
|
||||
}
|
||||
vdump $anImage2
|
||||
|
||||
# -------------------------------------
|
||||
# Check edge
|
||||
# -------------------------------------
|
||||
vselect 163 242
|
||||
if {[vreadpixel 141 234 name] != "GRAY76 1"} {
|
||||
puts "ERROR: Position of TOP-RIGHT camera is wrong."
|
||||
}
|
||||
vdump $anImage3
|
||||
|
||||
# -------------------------------------
|
||||
# Check vertex
|
||||
# -------------------------------------
|
||||
vselect 121 213
|
||||
if {[vreadpixel 120 250 name] != "GRAY95 1"} {
|
||||
puts "ERROR: Position of TOP-RIGHT-BACK camera is wrong."
|
||||
}
|
||||
vdump $anImage4
|
||||
|
||||
vviewcube -remove
|
||||
vclear
|
46
tests/v3d/viewcube/move
Normal file
46
tests/v3d/viewcube/move
Normal file
@@ -0,0 +1,46 @@
|
||||
puts "=================================="
|
||||
puts "AIS_ViewCube - check positioning of View Cube"
|
||||
puts "=================================="
|
||||
|
||||
set anImage1 $imagedir/${casename}_1.png
|
||||
set anImage2 $imagedir/${casename}_2.png
|
||||
set anImage3 $imagedir/${casename}_3.png
|
||||
set anImage4 $imagedir/${casename}_4.png
|
||||
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit
|
||||
|
||||
# -------------------------------------
|
||||
# display view cube object
|
||||
# -------------------------------------
|
||||
vviewcube -enable -size 70 -adaptsize
|
||||
|
||||
# -------------------------------------
|
||||
# check positioning of view cube object
|
||||
# -------------------------------------
|
||||
if {[vreadpixel 96 285 name] != "GRAY68 1"} {
|
||||
puts "ERROR: Bottom left View Cube fails."
|
||||
}
|
||||
vdump $anImage1
|
||||
|
||||
vviewcube -position 200 200
|
||||
if {[vreadpixel 200 176 name] != "GRAY68 1"} {
|
||||
puts "ERROR: Center View Cube fails."
|
||||
}
|
||||
vdump $anImage2
|
||||
|
||||
vviewcube -position 310 100
|
||||
if {[vreadpixel 310 73 name] != "GRAY68 1"} {
|
||||
puts "ERROR: Top right View Cube fails."
|
||||
}
|
||||
vdump $anImage3
|
||||
|
||||
vviewcube -position 140 240
|
||||
if {[vreadpixel 140 217 name] != "GRAY68 1"} {
|
||||
puts "ERROR: Custom View Cube fails."
|
||||
}
|
||||
vdump $anImage4
|
||||
|
||||
vviewcube -remove
|
||||
vclear
|
33
tests/v3d/viewcube/part
Normal file
33
tests/v3d/viewcube/part
Normal file
@@ -0,0 +1,33 @@
|
||||
puts "====================================="
|
||||
puts "AIS_ViewCube - test custom appearance"
|
||||
puts "====================================="
|
||||
|
||||
set anImage1 $imagedir/${casename}_1.png
|
||||
set anImage2 $imagedir/${casename}_2.png
|
||||
set anImage3 $imagedir/${casename}_3.png
|
||||
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit
|
||||
|
||||
vviewcube -enable -hideedges
|
||||
if {[vreadpixel 186 236 name] != "BLACK 0"} {
|
||||
puts "ERROR: Invalid display of View Cube without edges."
|
||||
}
|
||||
vdump $anImage1
|
||||
|
||||
vviewcube -showedges -hidevertices
|
||||
if {[vreadpixel 150 258 name] != "BLACK 0"} {
|
||||
puts "ERROR: Invalid display of View Cube without vertices."
|
||||
}
|
||||
vdump $anImage2
|
||||
|
||||
vviewcube -hideedges -hidevertices
|
||||
|
||||
if {[vreadpixel 186 236 name] != "BLACK 0" || [vreadpixel 150 258 name] != "BLACK 0"} {
|
||||
puts "ERROR: Invalid display of View Cube without edges & vertices."
|
||||
}
|
||||
vdump $anImage3
|
||||
|
||||
vviewcube -remove
|
||||
vclear
|
84
tests/v3d/viewcube/style
Normal file
84
tests/v3d/viewcube/style
Normal file
@@ -0,0 +1,84 @@
|
||||
puts "=================================="
|
||||
puts "AIS_ViewCube - display custom styled View Cube"
|
||||
puts "=================================="
|
||||
|
||||
set anImage1 $imagedir/${casename}_1.png
|
||||
set anImage2 $imagedir/${casename}_2.png
|
||||
set anImage3 $imagedir/${casename}_3.png
|
||||
set anImage4 $imagedir/${casename}_4.png
|
||||
set anImage5 $imagedir/${casename}_5.png
|
||||
set anImage6 $imagedir/${casename}_6.png
|
||||
set anImage7 $imagedir/${casename}_7.png
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit
|
||||
|
||||
# -------------------------------------
|
||||
# Color
|
||||
# -------------------------------------
|
||||
vviewcube -enable -boxcolor 0.69 0.88 1 -arrowcolor 0 0.4 0.54 -textcolor 0 0.4 0.54
|
||||
if {[vreadpixel 118 273 name] != "LIGHTSLATEGRAY 1" || [vreadpixel 270 260 name] != "GRAY15 0.24705882370471954"} {
|
||||
puts "ERROR: Errors in changing View Cube colors."
|
||||
}
|
||||
vdump $anImage1
|
||||
|
||||
# -------------------------------------
|
||||
# Transparency
|
||||
# -------------------------------------
|
||||
vviewcube -reset
|
||||
vviewcube -transparency 0.5
|
||||
if {[vreadpixel 118 273 name] != "GRAY17 0.37254902720451355" || [vreadpixel 270 260 name] != "GRAY48 0.24705882370471954"} {
|
||||
puts "ERROR: Errors in changing View Cube common transparency."
|
||||
}
|
||||
vdump $anImage2
|
||||
|
||||
vviewcube -reset
|
||||
vviewcube -boxtransparency 0.4 -arrowtransparency 0.2
|
||||
if {[vreadpixel 118 273 name] != "GRAY16 0.5058823823928833" || [vreadpixel 270 260 name] != "GRAY76 0.63921570777893066"} {
|
||||
puts "ERROR: Errors in changing View Cube separate transparency."
|
||||
}
|
||||
vdump $anImage3
|
||||
|
||||
# -------------------------------------
|
||||
# Arrows
|
||||
# -------------------------------------
|
||||
vviewcube -reset
|
||||
vviewcube -arrowangle 30 -arrowlength 30
|
||||
if {[vreadpixel 270 268 name] != "BLACK 0" || [vreadpixel 291 259 name] != "GRAY48 0.24705882370471954"} {
|
||||
puts "ERROR: Errors in changing View Cube arrow style."
|
||||
}
|
||||
vdump $anImage4
|
||||
|
||||
# -------------------------------------
|
||||
# Font
|
||||
# -------------------------------------
|
||||
vviewcube -reset
|
||||
vviewcube -font "Impact" -fontheight 16
|
||||
if {[vreadpixel 150 200 name] != "BLACK 0.729411780834198" || [vreadpixel 168 391 name] != "RED 1"} {
|
||||
puts "ERROR: Errors in changing View Cube font."
|
||||
}
|
||||
vdump $anImage5
|
||||
# -------------------------------------
|
||||
# Padding
|
||||
# -------------------------------------
|
||||
vviewcube -reset
|
||||
vviewcube -boxpadding 10 -axispadding 20 -arrowpadding 10
|
||||
if {[vreadpixel 71 263 name] != "BLACK 0" || [vreadpixel 37 266 name] != "BLUE2 1"} {
|
||||
puts "ERROR: Errors in changing View Cube padding."
|
||||
}
|
||||
vdump $anImage6
|
||||
# -------------------------------------
|
||||
# Corner radius
|
||||
# -------------------------------------
|
||||
vviewcube -reset
|
||||
vviewcube -cornerradius 0.2
|
||||
vdump $anImage7
|
||||
|
||||
vviewcube -remove
|
||||
vclear
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
28
tests/v3d/viewcube/view
Normal file
28
tests/v3d/viewcube/view
Normal file
@@ -0,0 +1,28 @@
|
||||
puts "=================================="
|
||||
puts "AIS_ViewCube - check view affinity"
|
||||
puts "=================================="
|
||||
|
||||
set anImage1 $imagedir/${casename}_1.png
|
||||
set anImage2 $imagedir/${casename}_2.png
|
||||
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit view1
|
||||
vinit view2
|
||||
|
||||
vviewcube -enable
|
||||
|
||||
if {[vreadpixel 150 220 name] != "GRAY68 1"} {
|
||||
puts "ERROR: display of View Cube in view2 fails."
|
||||
}
|
||||
vdump $anImage1
|
||||
|
||||
vactivate view1
|
||||
|
||||
if {[vreadpixel 150 220 name] != "BLACK 0"} {
|
||||
puts "ERROR: View Cube should not be displayed in view1."
|
||||
}
|
||||
vdump $anImage2
|
||||
|
||||
vactivate view2
|
||||
vviewcube -remove
|
25
tests/v3d/viewcube/view2
Normal file
25
tests/v3d/viewcube/view2
Normal file
@@ -0,0 +1,25 @@
|
||||
puts "=================================="
|
||||
puts "AIS_ViewCube - check view affinity"
|
||||
puts "=================================="
|
||||
|
||||
set anImage1 $imagedir/${casename}_1.png
|
||||
set anImage2 $imagedir/${casename}_2.png
|
||||
|
||||
vclear
|
||||
vclose ALL
|
||||
vinit view1
|
||||
|
||||
vviewcube -enable
|
||||
if {[vreadpixel 150 220 name] != "GRAY68 1"} {
|
||||
puts "ERROR: display of View Cube in view1 fails."
|
||||
}
|
||||
vdump $anImage1
|
||||
vviewcube -remove
|
||||
|
||||
vinit view2
|
||||
vviewcube -enable
|
||||
if {[vreadpixel 150 220 name] != "GRAY68 1"} {
|
||||
puts "ERROR: View Cube should not be displayed in view1."
|
||||
}
|
||||
vdump $anImage2
|
||||
vviewcube -remove
|
Reference in New Issue
Block a user