MOAB: Mesh Oriented datABase  (version 5.5.0)
VtkWriter Class Reference
+ Inheritance diagram for VtkWriter:
+ Collaboration diagram for VtkWriter:

Public Member Functions

 VtkWriter (std::string base_name, Interface *interface)
 
ErrorCode visit (EntityHandle node, int depth, bool &descend)
 Visit a node in the tree during a traversal. More...
 
ErrorCode leaf (EntityHandle)
 Process a leaf node during tree traversal. More...
 
- Public Member Functions inherited from moab::OrientedBoxTreeTool::Op
virtual ~Op ()
 

Private Attributes

std::string baseName
 
Interfaceinstance
 

Detailed Description

Definition at line 684 of file obb_test.cpp.

Constructor & Destructor Documentation

◆ VtkWriter()

VtkWriter::VtkWriter ( std::string  base_name,
Interface interface 
)
inline

Definition at line 687 of file obb_test.cpp.

687 : baseName( base_name ), instance( interface ) {}

Member Function Documentation

◆ leaf()

ErrorCode VtkWriter::leaf ( EntityHandle  node)
inlinevirtual

Process a leaf node during tree traversal.

Implements moab::OrientedBoxTreeTool::Op.

Definition at line 691 of file obb_test.cpp.

692  {
693  return MB_SUCCESS;
694  }

References MB_SUCCESS.

◆ visit()

ErrorCode VtkWriter::visit ( EntityHandle  node,
int  depth,
bool &  descend 
)
virtual

Visit a node in the tree during a traversal.

This method is called for each node in the tree visited during a pre-order traversal.

Parameters
nodeThe EntityHandle for the entity set for the tree node.
depthThe current depth in the tree.
descendOutput: if false, traversal will skip children of the current node, or if the current node is a leaf, the 'leaf' method will not be called.

Implements moab::OrientedBoxTreeTool::Op.

Definition at line 701 of file obb_test.cpp.

702 {
703  descend = true;
704 
705  ErrorCode rval;
706  int count;
707  rval = instance->get_number_entities_by_handle( node, count );
708  if( MB_SUCCESS != rval || 0 == count ) return rval;
709 
710  int id = instance->id_from_handle( node );
711  char id_str[32];
712  sprintf( id_str, "%d", id );
713 
714  std::string file_name( baseName );
715  file_name += ".";
716  file_name += id_str;
717  file_name += ".vtk";
718 
719  return instance->write_mesh( file_name.c_str(), &node, 1 );
720 }

References ErrorCode, and MB_SUCCESS.

Member Data Documentation

◆ baseName

std::string VtkWriter::baseName
private

Definition at line 697 of file obb_test.cpp.

◆ instance

Interface* VtkWriter::instance
private

Definition at line 698 of file obb_test.cpp.


The documentation for this class was generated from the following file: