cadsurf_set_param(css, "verbose", to_string(_verb).c_str());
_smp_phy_size = _phySizeRel ? _phySize*diagonal : _phySize;
- std::cout << "_smp_phy_size = " << _smp_phy_size << std::endl;
+ if ( _verb > 0 )
+ std::cout << "_smp_phy_size = " << _smp_phy_size << std::endl;
if (_physicalMesh == BLSURFPlugin_Hypothesis::PhysicalLocalSize){
TopoDS_Shape GeomShape;
}
};
+ /*!
+ * \brief A structure holding an error description and a verbisity level
+ */
+ struct message_cb_user_data
+ {
+ std::string * _error;
+ int _verbosity;
+ };
+
} // namespace
context_t *ctx = context_new();
/* Set the message callback in the working context */
- context_set_message_callback(ctx, message_cb, &_comment);
-#ifdef WITH_SMESH_CANCEL_COMPUTE
+ message_cb_user_data mcud;
+ mcud._error = & this->SMESH_Algo::_comment;
+ mcud._verbosity =
+ _hypothesis ? _hypothesis->GetVerbosity() : BLSURFPlugin_Hypothesis::GetDefaultVerbosity();
+ context_set_message_callback(ctx, message_cb, &mcud);
+
+ /* set the interruption callback */
_compute_canceled = false;
context_set_interrupt_callback(ctx, interrupt_cb, this);
-#else
- context_set_interrupt_callback(ctx, interrupt_cb, NULL);
-#endif
/* create the CAD object we will work on. It is associated to the context ctx. */
cad_t *c = cad_new(ctx);
message_get_number(msg, &errnumber);
message_get_description(msg, &desc);
string err( desc );
+ message_cb_user_data * mcud = (message_cb_user_data*)user_data;
if ( errnumber < 0 || err.find("license") != string::npos ) {
- string * error = (string*)user_data;
-// if ( !error->empty() )
-// *error += "\n";
// remove ^A from the tail
int len = strlen( desc );
while (len > 0 && desc[len-1] != '\n')
len--;
- error->append( desc, len );
+ mcud->_error->append( desc, len );
}
- else {
- std::cout << desc << std::endl;
+ else if ( mcud->_verbosity > 0 ) {
+ std::cout << desc << std::endl;
}
return STATUS_OK;
}