2016-03-18 22:10:20 +05:00
|
|
|
// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
|
2008-03-07 12:47:05 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
|
|
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
2008-03-07 12:47:05 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
2014-02-20 18:25:37 +06:00
|
|
|
// version 2.1 of the License, or (at your option) any later version.
|
2008-03-07 12:47:05 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
2008-03-07 12:47:05 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2008-03-07 12:47:05 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2008-03-07 12:47:05 +05:00
|
|
|
//
|
2012-08-09 16:03:55 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// SMESH SMESHGUI : GUI for SMESH component
|
|
|
|
// File : SMESHGUI_MeshEditPreview.cxx
|
|
|
|
// Author : Open CASCADE S.A.S.
|
|
|
|
// SMESH includes
|
2008-03-07 12:47:05 +05:00
|
|
|
//
|
|
|
|
#include "SMESHGUI_MeshEditPreview.h"
|
|
|
|
|
|
|
|
#include "SMESHGUI_VTKUtils.h"
|
2014-02-04 19:06:14 +06:00
|
|
|
#include "SMESH_Actor.h"
|
|
|
|
#include "SMESH_ActorUtils.h"
|
2009-02-17 10:27:49 +05:00
|
|
|
|
|
|
|
// SALOME GUI includes
|
2014-02-04 19:06:14 +06:00
|
|
|
#include <SVTK_Renderer.h>
|
2009-02-17 10:27:49 +05:00
|
|
|
#include <SVTK_ViewWindow.h>
|
2014-02-04 19:06:14 +06:00
|
|
|
#include <VTKViewer_CellLocationsArray.h>
|
2009-02-17 10:27:49 +05:00
|
|
|
|
|
|
|
// VTK includes
|
2008-03-07 12:47:05 +05:00
|
|
|
#include <vtkCellArray.h>
|
2014-02-04 19:06:14 +06:00
|
|
|
#include <vtkCoordinate.h>
|
2008-03-07 12:47:05 +05:00
|
|
|
#include <vtkDataSetMapper.h>
|
2014-02-04 19:06:14 +06:00
|
|
|
#include <vtkIdList.h>
|
|
|
|
#include <vtkPoints.h>
|
2008-03-07 12:47:05 +05:00
|
|
|
#include <vtkProperty.h>
|
2014-02-04 19:06:14 +06:00
|
|
|
#include <vtkRenderer.h>
|
|
|
|
#include <vtkTextActor.h>
|
|
|
|
#include <vtkTextMapper.h>
|
|
|
|
#include <vtkUnsignedCharArray.h>
|
|
|
|
#include <vtkUnstructuredGrid.h>
|
2008-03-07 12:47:05 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// Qt includes
|
|
|
|
#include <QColor>
|
2008-03-07 12:47:05 +05:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
// IDL includes
|
|
|
|
#include <SALOMEconfig.h>
|
2008-03-07 12:47:05 +05:00
|
|
|
#include CORBA_SERVER_HEADER(SMESH_MeshEditor)
|
|
|
|
|
2014-01-20 16:34:46 +06:00
|
|
|
#include <gp_Ax3.hxx>
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Constructor
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
|
|
|
SMESHGUI_MeshEditPreview::SMESHGUI_MeshEditPreview(SVTK_ViewWindow* theViewWindow):
|
|
|
|
myViewWindow(theViewWindow)
|
|
|
|
{
|
|
|
|
myGrid = vtkUnstructuredGrid::New();
|
|
|
|
|
|
|
|
// Create and display actor
|
|
|
|
vtkDataSetMapper* aMapper = vtkDataSetMapper::New();
|
2013-03-01 19:13:25 +06:00
|
|
|
aMapper->SetInputData( myGrid );
|
2008-03-07 12:47:05 +05:00
|
|
|
|
|
|
|
myPreviewActor = SALOME_Actor::New();
|
|
|
|
myPreviewActor->SetInfinitive(true);
|
|
|
|
myPreviewActor->VisibilityOn();
|
|
|
|
myPreviewActor->PickableOff();
|
|
|
|
|
2013-03-01 19:13:25 +06:00
|
|
|
double aFactor,aUnits;
|
2012-08-09 16:03:55 +06:00
|
|
|
myPreviewActor->SetResolveCoincidentTopology(true);
|
|
|
|
myPreviewActor->GetPolygonOffsetParameters(aFactor,aUnits);
|
|
|
|
myPreviewActor->SetPolygonOffsetParameters(aFactor,0.2*aUnits);
|
|
|
|
|
2013-03-01 19:13:25 +06:00
|
|
|
double anRGB[3];
|
2009-02-17 10:27:49 +05:00
|
|
|
SMESH::GetColor( "SMESH", "selection_element_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
|
2008-03-07 12:47:05 +05:00
|
|
|
SetColor( anRGB[0], anRGB[1], anRGB[2] );
|
|
|
|
|
|
|
|
myPreviewActor->SetMapper( aMapper );
|
|
|
|
aMapper->Delete();
|
|
|
|
|
|
|
|
myViewWindow->AddActor(myPreviewActor);
|
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Destroy
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
|
|
|
SMESHGUI_MeshEditPreview::~SMESHGUI_MeshEditPreview()
|
|
|
|
{
|
|
|
|
myGrid->Delete();
|
|
|
|
|
2014-02-04 19:06:14 +06:00
|
|
|
for ( size_t iA = 0; iA < myLabelActors.size(); ++iA )
|
|
|
|
if ( myLabelActors[iA] )
|
|
|
|
{
|
|
|
|
myPreviewActor->GetRenderer()->RemoveActor( myLabelActors[iA] );
|
|
|
|
myLabelActors[iA]->Delete();
|
|
|
|
}
|
2014-02-05 14:20:55 +06:00
|
|
|
|
|
|
|
myViewWindow->RemoveActor(myPreviewActor);
|
|
|
|
myPreviewActor->Delete();
|
2008-03-07 12:47:05 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Returns vtk cell type
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
|
|
|
vtkIdType getCellType( const SMDSAbs_ElementType theType,
|
2013-05-16 23:17:56 +06:00
|
|
|
const bool thePoly,
|
|
|
|
const int theNbNodes )
|
2008-03-07 12:47:05 +05:00
|
|
|
{
|
|
|
|
switch( theType )
|
|
|
|
{
|
2014-10-30 21:30:46 +05:00
|
|
|
case SMDSAbs_Ball: return VTK_VERTEX;
|
2008-03-07 12:47:05 +05:00
|
|
|
case SMDSAbs_Node: return VTK_VERTEX;
|
2014-10-30 21:30:46 +05:00
|
|
|
case SMDSAbs_Edge:
|
2008-03-07 12:47:05 +05:00
|
|
|
if( theNbNodes == 2 ) return VTK_LINE;
|
|
|
|
else if ( theNbNodes == 3 ) return VTK_QUADRATIC_EDGE;
|
|
|
|
else return VTK_EMPTY_CELL;
|
|
|
|
|
|
|
|
case SMDSAbs_Face :
|
|
|
|
if (thePoly && theNbNodes>2 ) return VTK_POLYGON;
|
|
|
|
else if ( theNbNodes == 3 ) return VTK_TRIANGLE;
|
|
|
|
else if ( theNbNodes == 4 ) return VTK_QUAD;
|
|
|
|
else if ( theNbNodes == 6 ) return VTK_QUADRATIC_TRIANGLE;
|
2013-05-16 23:17:56 +06:00
|
|
|
else if ( theNbNodes == 7 ) return VTK_BIQUADRATIC_TRIANGLE;
|
2008-03-07 12:47:05 +05:00
|
|
|
else if ( theNbNodes == 8 ) return VTK_QUADRATIC_QUAD;
|
2012-08-09 16:03:55 +06:00
|
|
|
else if ( theNbNodes == 9 ) return VTK_BIQUADRATIC_QUAD;
|
2008-03-07 12:47:05 +05:00
|
|
|
else return VTK_EMPTY_CELL;
|
|
|
|
|
|
|
|
case SMDSAbs_Volume:
|
|
|
|
if (thePoly && theNbNodes>3 ) return VTK_CONVEX_POINT_SET;
|
|
|
|
else if ( theNbNodes == 4 ) return VTK_TETRA;
|
|
|
|
else if ( theNbNodes == 5 ) return VTK_PYRAMID;
|
|
|
|
else if ( theNbNodes == 6 ) return VTK_WEDGE;
|
|
|
|
else if ( theNbNodes == 8 ) return VTK_HEXAHEDRON;
|
2012-08-09 16:03:55 +06:00
|
|
|
else if ( theNbNodes == 10 ) return VTK_QUADRATIC_TETRA;
|
|
|
|
else if ( theNbNodes == 20 ) return VTK_QUADRATIC_HEXAHEDRON;
|
|
|
|
else if ( theNbNodes == 27 ) return VTK_TRIQUADRATIC_HEXAHEDRON;
|
|
|
|
else if ( theNbNodes == 15 ) return VTK_QUADRATIC_WEDGE;
|
2017-09-15 01:28:11 +05:00
|
|
|
else if ( theNbNodes == 18 ) return VTK_BIQUADRATIC_QUADRATIC_WEDGE;
|
2012-08-09 16:03:55 +06:00
|
|
|
else if ( theNbNodes == 13 ) return VTK_QUADRATIC_PYRAMID;//VTK_CONVEX_POINT_SET;
|
2008-03-07 12:47:05 +05:00
|
|
|
else return VTK_EMPTY_CELL;
|
|
|
|
|
|
|
|
default: return VTK_EMPTY_CELL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Set preview data
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
2018-11-14 18:41:52 +05:00
|
|
|
void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct& previewData)
|
2008-03-07 12:47:05 +05:00
|
|
|
{
|
|
|
|
// Create points
|
2018-11-14 18:41:52 +05:00
|
|
|
const SMESH::nodes_array& aNodesXYZ = previewData.nodesXYZ;
|
2008-03-07 12:47:05 +05:00
|
|
|
vtkPoints* aPoints = vtkPoints::New();
|
|
|
|
aPoints->SetNumberOfPoints(aNodesXYZ.length());
|
|
|
|
|
2015-10-27 22:47:31 +05:00
|
|
|
for ( size_t i = 0; i < aNodesXYZ.length(); i++ ) {
|
2008-03-07 12:47:05 +05:00
|
|
|
aPoints->SetPoint( i, aNodesXYZ[i].x, aNodesXYZ[i].y, aNodesXYZ[i].z );
|
|
|
|
}
|
|
|
|
myGrid->SetPoints(aPoints);
|
|
|
|
|
|
|
|
aPoints->Delete();
|
|
|
|
|
|
|
|
// Create cells
|
2018-11-14 18:41:52 +05:00
|
|
|
const SMESH::long_array& anElemConnectivity = previewData.elementConnectivities;
|
|
|
|
const SMESH::types_array& anElemTypes = previewData.elementTypes;
|
2008-03-07 12:47:05 +05:00
|
|
|
|
|
|
|
vtkIdType aCellsSize = anElemConnectivity.length() + anElemTypes.length();
|
|
|
|
vtkIdType aNbCells = anElemTypes.length();
|
|
|
|
|
|
|
|
vtkCellArray* aConnectivity = vtkCellArray::New();
|
|
|
|
aConnectivity->Allocate( aCellsSize, 0 );
|
|
|
|
|
|
|
|
vtkUnsignedCharArray* aCellTypesArray = vtkUnsignedCharArray::New();
|
|
|
|
aCellTypesArray->SetNumberOfComponents( 1 );
|
|
|
|
aCellTypesArray->Allocate( aNbCells * aCellTypesArray->GetNumberOfComponents() );
|
|
|
|
|
|
|
|
vtkIdList *anIdList = vtkIdList::New();
|
|
|
|
int aNodePos = 0;
|
|
|
|
|
2015-10-27 22:47:31 +05:00
|
|
|
for ( size_t i = 0; i < anElemTypes.length(); i++ ) {
|
2009-02-17 10:27:49 +05:00
|
|
|
const SMESH::ElementSubType& anElementSubType = anElemTypes[i];
|
2008-03-07 12:47:05 +05:00
|
|
|
SMDSAbs_ElementType aType = SMDSAbs_ElementType(anElementSubType.SMDS_ElementType);
|
|
|
|
vtkIdType aNbNodes = anElementSubType.nbNodesInElement;
|
|
|
|
anIdList->SetNumberOfIds( aNbNodes );
|
|
|
|
|
|
|
|
for ( vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++ ){
|
|
|
|
anIdList->SetId( aNodeId, anElemConnectivity[aNodePos] );
|
|
|
|
aNodePos++;
|
|
|
|
}
|
|
|
|
|
|
|
|
aConnectivity->InsertNextCell( anIdList );
|
|
|
|
aCellTypesArray->InsertNextValue( getCellType( aType,
|
|
|
|
anElemTypes[i].isPoly,
|
|
|
|
aNbNodes ) );
|
|
|
|
}
|
|
|
|
anIdList->Delete();
|
|
|
|
|
|
|
|
// Insert cells in grid
|
|
|
|
VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
|
|
|
|
aCellLocationsArray->SetNumberOfComponents( 1 );
|
|
|
|
aCellLocationsArray->SetNumberOfTuples( aNbCells );
|
|
|
|
|
|
|
|
aConnectivity->InitTraversal();
|
|
|
|
for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
|
|
|
|
aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
|
|
|
|
|
|
|
|
myGrid->SetCells( aCellTypesArray, aCellLocationsArray, aConnectivity );
|
|
|
|
|
|
|
|
myPreviewActor->GetMapper()->Update();
|
|
|
|
|
|
|
|
aCellTypesArray->Delete();
|
|
|
|
aCellLocationsArray->Delete();
|
|
|
|
aConnectivity->Delete();
|
|
|
|
|
|
|
|
SetVisibility(true);
|
|
|
|
}
|
|
|
|
|
2014-01-20 16:34:46 +06:00
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Set shape of an arrow of a unit length and nb of arrows
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
2014-02-04 19:06:14 +06:00
|
|
|
void SMESHGUI_MeshEditPreview::SetArrowShapeAndNb( int nbArrows,
|
|
|
|
double headLength,
|
|
|
|
double headRadius,
|
|
|
|
double start,
|
|
|
|
const char* labels)
|
2014-01-20 16:34:46 +06:00
|
|
|
{
|
|
|
|
const int theNbPoints = 10; // in one arrow
|
|
|
|
myUnitArrowPnts.reserve( theNbPoints );
|
|
|
|
myUnitArrowPnts.clear();
|
|
|
|
|
|
|
|
// unit arrow || OZ
|
|
|
|
|
|
|
|
for ( int i = 0; i < theNbPoints - 2; ++i )
|
|
|
|
{
|
|
|
|
double angle = i * 2 * M_PI / ( theNbPoints - 2 );
|
|
|
|
myUnitArrowPnts.push_back( gp_Pnt( headRadius * Cos( angle ),
|
|
|
|
headRadius * Sin( angle ),
|
|
|
|
1. - headLength ));
|
|
|
|
}
|
|
|
|
myUnitArrowPnts.push_back( gp_Pnt( 0, 0, start ));
|
|
|
|
myUnitArrowPnts.push_back( gp_Pnt( 0, 0, 1 ));
|
|
|
|
|
|
|
|
|
|
|
|
// nodes of all arrows
|
|
|
|
|
|
|
|
vtkPoints* aPoints = vtkPoints::New();
|
|
|
|
aPoints->SetNumberOfPoints( theNbPoints * nbArrows );
|
|
|
|
for ( int iP = 0, iA = 0; iA < nbArrows; ++iA )
|
|
|
|
for ( int i = 0; i < theNbPoints; ++i, ++iP )
|
|
|
|
aPoints->SetPoint( iP,
|
|
|
|
myUnitArrowPnts[i].X(),
|
|
|
|
myUnitArrowPnts[i].Y(),
|
|
|
|
myUnitArrowPnts[i].Z() );
|
|
|
|
myGrid->SetPoints(aPoints);
|
|
|
|
aPoints->Delete();
|
|
|
|
|
|
|
|
// connectivity of all arrows
|
|
|
|
|
|
|
|
const int theNbCells = ( theNbPoints - 1 ); // in one arrow
|
|
|
|
myGrid->Allocate( theNbCells * nbArrows );
|
|
|
|
for ( int nP = 0, iA = 0; iA < nbArrows; ++iA, nP += theNbPoints )
|
|
|
|
{
|
|
|
|
vtkIdType conn[3] = { theNbPoints - 1 + nP, // arrow end
|
|
|
|
theNbPoints - 3 + nP, // point on a circle
|
|
|
|
nP }; // point on a circle
|
|
|
|
for ( int i = 0; i < theNbCells-1; ++i )
|
|
|
|
{
|
|
|
|
myGrid->InsertNextCell( VTK_TRIANGLE, 3, conn );
|
|
|
|
conn[1] = conn[2];
|
|
|
|
conn[2] = conn[2] + 1;
|
|
|
|
}
|
|
|
|
conn[1] = theNbPoints - 2 + nP;
|
|
|
|
myGrid->InsertNextCell( VTK_LINE, 2, conn );
|
|
|
|
}
|
|
|
|
|
2014-02-04 19:06:14 +06:00
|
|
|
myLabelActors.resize( nbArrows, ( vtkTextActor*) NULL );
|
|
|
|
char label[] = "X";
|
|
|
|
if ( labels )
|
2015-10-27 22:47:31 +05:00
|
|
|
for ( int iA = 0; iA < nbArrows; ++iA )
|
2014-02-04 19:06:14 +06:00
|
|
|
{
|
|
|
|
label[0] = labels[iA];
|
|
|
|
vtkTextMapper* text = vtkTextMapper::New();
|
|
|
|
text->SetInput( label );
|
|
|
|
vtkCoordinate* coord = vtkCoordinate::New();
|
|
|
|
|
|
|
|
myLabelActors[iA] = vtkTextActor::New();
|
|
|
|
//myLabelActors[iA]->SetMapper( text );
|
|
|
|
myLabelActors[iA]->SetInput( label );
|
|
|
|
myLabelActors[iA]->SetTextScaleModeToNone();
|
|
|
|
myLabelActors[iA]->PickableOff();
|
|
|
|
myLabelActors[iA]->GetPositionCoordinate()->SetReferenceCoordinate( coord );
|
|
|
|
|
|
|
|
text->Delete();
|
|
|
|
coord->Delete();
|
|
|
|
|
|
|
|
myPreviewActor->GetRenderer()->AddActor(myLabelActors[iA]);
|
|
|
|
}
|
2014-01-20 16:34:46 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Set data to show moved/rotated/scaled arrows
|
|
|
|
* \param [in] axes - location and direction of the arrows
|
|
|
|
* \param [in] length - length of arrows
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
|
|
|
void SMESHGUI_MeshEditPreview::SetArrows( const gp_Ax1* axes,
|
|
|
|
double length )
|
|
|
|
{
|
|
|
|
vtkPoints* aPoints = myGrid->GetPoints();
|
|
|
|
|
2015-10-27 22:47:31 +05:00
|
|
|
for ( int iP = 0, iA = 0; iA < (int) myLabelActors.size(); ++iA )
|
2014-01-20 16:34:46 +06:00
|
|
|
{
|
|
|
|
gp_Trsf trsf;
|
|
|
|
trsf.SetTransformation( gp_Ax3( axes[iA].Location(), axes[iA].Direction() ), gp::XOY() );
|
|
|
|
|
|
|
|
for ( size_t i = 0; i < myUnitArrowPnts.size(); ++i, ++iP )
|
|
|
|
{
|
|
|
|
gp_Pnt p = myUnitArrowPnts[i].Scaled( gp::Origin(), length );
|
|
|
|
p.Transform( trsf );
|
|
|
|
aPoints->SetPoint( iP, p.X(), p.Y(), p.Z() );
|
|
|
|
}
|
2014-02-04 19:06:14 +06:00
|
|
|
if ( myLabelActors[iA] )
|
|
|
|
if ( vtkCoordinate* aCoord =
|
|
|
|
myLabelActors[iA]->GetPositionCoordinate()->GetReferenceCoordinate() )
|
|
|
|
{
|
|
|
|
double p[3];
|
|
|
|
aPoints->GetPoint( iP-1, p );
|
|
|
|
aCoord->SetValue( p );
|
|
|
|
}
|
2014-01-20 16:34:46 +06:00
|
|
|
}
|
|
|
|
|
|
|
|
myGrid->Modified();
|
|
|
|
}
|
|
|
|
|
2008-03-07 12:47:05 +05:00
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Set visibility
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
|
|
|
void SMESHGUI_MeshEditPreview::SetVisibility (bool theVisibility)
|
|
|
|
{
|
|
|
|
myPreviewActor->SetVisibility(theVisibility);
|
2014-02-04 19:06:14 +06:00
|
|
|
for ( size_t iA = 0; iA < myLabelActors.size(); ++iA )
|
|
|
|
if ( myLabelActors[iA] )
|
|
|
|
myLabelActors[iA]->SetVisibility(theVisibility);
|
2009-02-17 10:27:49 +05:00
|
|
|
SMESH::RepaintCurrentView();
|
2008-03-07 12:47:05 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Set preview color
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
|
|
|
void SMESHGUI_MeshEditPreview::SetColor(double R, double G, double B)
|
|
|
|
{
|
|
|
|
myPreviewActor->SetColor( R, G, B );
|
|
|
|
}
|
2009-02-17 10:27:49 +05:00
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Get preview actor
|
|
|
|
*/
|
|
|
|
//================================================================================
|
2014-01-20 16:34:46 +06:00
|
|
|
|
2009-02-17 10:27:49 +05:00
|
|
|
SALOME_Actor* SMESHGUI_MeshEditPreview::GetActor() const
|
|
|
|
{
|
|
|
|
return myPreviewActor;
|
|
|
|
}
|
2014-01-20 16:34:46 +06:00
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Returns the priewed vtkUnstructuredGrid
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
|
|
|
vtkUnstructuredGrid* SMESHGUI_MeshEditPreview::GetGrid() const
|
|
|
|
{
|
|
|
|
return myGrid;
|
|
|
|
}
|
2016-03-18 17:42:33 +05:00
|
|
|
|
|
|
|
//================================================================================
|
|
|
|
/*!
|
|
|
|
* \brief Returns myViewWindow
|
|
|
|
*/
|
|
|
|
//================================================================================
|
|
|
|
|
|
|
|
SVTK_ViewWindow* SMESHGUI_MeshEditPreview::GetViewWindow() const
|
|
|
|
{
|
|
|
|
return myViewWindow;
|
|
|
|
}
|