本文整理汇总了C++中TError::IsOK方法的典型用法代码示例。如果您正苦于以下问题:C++ TError::IsOK方法的具体用法?C++ TError::IsOK怎么用?C++ TError::IsOK使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TError
的用法示例。
在下文中一共展示了TError::IsOK方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: helper
bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
const TopoDS_Shape& aShape)
{
MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::Compute()");
SMESHDS_Mesh* meshDS = aMesh.GetMeshDS();
int faceID = meshDS->ShapeToIndex( aShape );
SMESH_MesherHelper helper(aMesh);
_quadraticMesh = helper.IsQuadraticSubMesh(aShape);
helper.SetElementsOnShape( true );
const bool ignoreMediumNodes = _quadraticMesh;
// ------------------------
// get all edges of a face
// ------------------------
const TopoDS_Face F = TopoDS::Face( aShape.Oriented( TopAbs_FORWARD ));
TError problem;
TSideVector wires = StdMeshers_FaceSide::GetFaceWires( F, aMesh, ignoreMediumNodes, problem );
if ( problem && !problem->IsOK() )
return error( problem );
int nbWires = wires.size();
if ( nbWires == 0 )
return error( "Problem in StdMeshers_FaceSide::GetFaceWires()");
if ( wires[0]->NbSegments() < 3 ) // ex: a circle with 2 segments
return error(COMPERR_BAD_INPUT_MESH,
SMESH_Comment("Too few segments: ")<<wires[0]->NbSegments());
// -------------------------
// Make input netgen mesh
// -------------------------
Ng_Init();
netgen::Mesh * ngMesh = new netgen::Mesh ();
netgen::OCCGeometry occgeo;
NETGENPlugin_Mesher::PrepareOCCgeometry( occgeo, F, aMesh );
occgeo.fmap.Clear(); // face can be reversed, which is wrong in this case (issue 19978)
occgeo.fmap.Add( F );
vector< const SMDS_MeshNode* > nodeVec;
problem = AddSegmentsToMesh( *ngMesh, occgeo, wires, helper, nodeVec );
if ( problem && !problem->IsOK() ) {
delete ngMesh; Ng_Exit();
return error( problem );
}
// --------------------
// compute edge length
// --------------------
double edgeLength = 0;
if (_hypLengthFromEdges || (!_hypLengthFromEdges && !_hypMaxElementArea))
{
int nbSegments = 0;
for ( int iW = 0; iW < nbWires; ++iW )
{
edgeLength += wires[ iW ]->Length();
nbSegments += wires[ iW ]->NbSegments();
}
if ( nbSegments )
edgeLength /= nbSegments;
}
if ( _hypMaxElementArea )
{
double maxArea = _hypMaxElementArea->GetMaxArea();
edgeLength = sqrt(2. * maxArea/sqrt(3.0));
}
if ( edgeLength < DBL_MIN )
edgeLength = occgeo.GetBoundingBox().Diam();
//cout << " edgeLength = " << edgeLength << endl;
netgen::mparam.maxh = edgeLength;
netgen::mparam.quad = _hypQuadranglePreference ? 1 : 0;
//ngMesh->SetGlobalH ( edgeLength );
// -------------------------
// Generate surface mesh
// -------------------------
char *optstr = 0;
int startWith = MESHCONST_MESHSURFACE;
int endWith = MESHCONST_OPTSURFACE;
int err = 1;
try {
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
OCC_CATCH_SIGNALS;
#endif
#ifdef NETGEN_V5
err = netgen::OCCGenerateMesh(occgeo, ngMesh,netgen::mparam, startWith, endWith);
#else
err = netgen::OCCGenerateMesh(occgeo, ngMesh, startWith, endWith, optstr);
#endif
}
catch (Standard_Failure& ex) {
string comment = ex.DynamicType()->Name();
if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) {
comment += ": ";
//.........这里部分代码省略.........