本文整理汇总了C++中TCollection_AsciiString类的典型用法代码示例。如果您正苦于以下问题:C++ TCollection_AsciiString类的具体用法?C++ TCollection_AsciiString怎么用?C++ TCollection_AsciiString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TCollection_AsciiString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: aTitle
//================================================================
// Function : Convert_Presentation::drawSurfaceAndItsBSpline
// Purpose :
//================================================================
void Convert_Presentation::drawSurfaceAndItsBSpline(Handle_Geom_Surface theSurface,
const Standard_CString theName,
TCollection_AsciiString& theText)
{
TCollection_AsciiString aTitle ("Converting ");
aTitle += theName;
aTitle += " to BSpline surface";
theText += EOL
" Handle_Geom_BSplineSurface aBSplineSurface = " EOL
" GeomConvert::SurfaceToBSplineSurface(aSurface);" EOL;
setResultTitle (aTitle.ToCString());
setResultText (theText.ToCString());
drawSurface (theSurface, SurfaceColor);
if (WAIT_A_LITTLE) return;
Handle_Geom_BSplineSurface aBSplineSurface = GeomConvert::SurfaceToBSplineSurface(theSurface);
_ASSERTE(!aBSplineSurface.IsNull());
drawSurface (aBSplineSurface, BSplineSurfaceColor);
}
示例2: ExportSTEP
SALOME_WNT_EXPORT
int ExportSTEP( const TopoDS_Shape& theShape,
const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName)
{
MESSAGE("Export STEP into file " << theFileName.ToCString());
try
{
IFSelect_ReturnStatus status ;
//VRV: OCC 4.0 migration
STEPControl_Writer aWriter;
//VSR: 16/09/09: Convert to METERS
Interface_Static::SetCVal("xstep.cascade.unit","M");
Interface_Static::SetIVal("write.step.nonmanifold", 1);
//JFA: PAL6162 status = aWriter.Transfer( theShape, STEPControl_ManifoldSolidBrep );
status = aWriter.Transfer( theShape, STEPControl_AsIs );
//VRV: OCC 4.0 migration
if ( status == IFSelect_RetDone )
status = aWriter.Write( theFileName.ToCString() ) ;
// Return previous locale
if ( status == IFSelect_RetDone )
return 1;
}
catch(Standard_Failure) {
Standard_Failure::Raise("Could not export in STEP format");
}
return 0;
}
示例3: AIS_TexturedShape
//////////////////////////////////////////////////////////////////////
// Sample functions
//////////////////////////////////////////////////////////////////////
//================================================================
// Function : TexturesExt_Presentation::Texturize
// display an AIS_TexturedShape based on a given shape with texture with given filename
// filename can also be an integer value ("2", "5", etc.), in this case
// a predefined texture from Graphic3d_NameOfTexture2D with number = this value
// is loaded.
//================================================================
Handle_AIS_TexturedShape TexturesExt_Presentation::Texturize(const TopoDS_Shape& aShape,
TCollection_AsciiString aTFileName,
Standard_Real toScaleU,
Standard_Real toScaleV,
Standard_Real toRepeatU,
Standard_Real toRepeatV,
Standard_Real originU,
Standard_Real originV)
{
// create a textured presentation object for aShape
Handle_AIS_TexturedShape aTShape = new AIS_TexturedShape(aShape);
TCollection_AsciiString TFileName;
// load texture from file if it is not an integer value
// integer value indicates a number of texture in predefined TexturesExt enumeration
CString initfile(((OCC_BaseApp*) AfxGetApp())->GetInitDataDir());
initfile += "\\Data\\";
if (!aTFileName.IsIntegerValue())
{
initfile += aTFileName.ToCString();
}
aTShape->SetTextureFileName((Standard_CString)(LPCTSTR)initfile);
// do other initialization of AIS_TexturedShape
aTShape->SetTextureMapOn();
aTShape->SetTextureScale(Standard_True, toScaleU, toScaleV);
aTShape->SetTextureRepeat(Standard_True, toRepeatU, toRepeatV);
aTShape->SetTextureOrigin(Standard_True, originU, originV);
aTShape->SetDisplayMode(3); // mode 3 is "textured" mode
return aTShape;
}
示例4: myOperations
ShHealOper_ShapeProcess::ShHealOper_ShapeProcess (const TCollection_AsciiString& theNameResource,
const TCollection_AsciiString& thePrefix ) :
myOperations(theNameResource.ToCString(),thePrefix.ToCString())
{
//myResource = new Resource_Manager(theNameResource);
myPrefix = thePrefix;
mySaveHistoryMode = Standard_False;
myLevel = TopAbs_FACE;
myDone = Standard_False;
}
示例5: writeFile
// write geometry
//////////////////
void writeFile( TCollection_AsciiString outFileName, Handle_TopTools_HSequenceOfShape shapes){
//get writer plugin
TCollection_AsciiString fileExtension = outFileName;
fileExtension = fileExtension.Split(fileExtension.SearchFromEnd(".")-1);
McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance();
McCadEXPlug_ExchangePlugin* writerPlugin = pluginManager->GetPlugin(fileExtension);
// write file
writerPlugin->SetFilename(outFileName);
writerPlugin->Export(shapes);
}
示例6: ExportBREP
SALOME_WNT_EXPORT
int ExportBREP( const TopoDS_Shape& theShape, const TCollection_AsciiString& theFileName)
{
MESSAGE("Export BREP into file " << theFileName.ToCString());
if ( !BRepTools::Write( theShape, theFileName.ToCString() ) )
return 0;
return 1;
}
示例7: readFile
// read file, return geometry
///////////////////////////////
Handle_TopTools_HSequenceOfShape readFile( TCollection_AsciiString fileName){
// get reader plugin
TCollection_AsciiString fileExtension = fileName;
fileExtension = fileExtension.Split(fileExtension.SearchFromEnd(".")-1);
McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance();
McCadEXPlug_ExchangePlugin* readerPlugin = pluginManager->GetPlugin(fileExtension);
// read file
readerPlugin->SetFilename(fileName);
Handle_TopTools_HSequenceOfShape shapes = new TopTools_HSequenceOfShape;
shapes = readerPlugin->Import();
return shapes;
}
示例8: anameParam
void ShHealOper_ShapeProcess::SetOperators(const TColStd_SequenceOfAsciiString& theSeqOperators)
{
TCollection_AsciiString anameParam(myPrefix);
anameParam += ".";
anameParam += "exec.op";
TCollection_AsciiString aseq;
Standard_Integer i =1;
for( ; i <= theSeqOperators.Length(); i++) {
aseq += theSeqOperators.Value(i);
aseq += " ";
}
myOperations.Context()->ResourceManager()->SetResource(anameParam.ToCString(),aseq.ToCString());
}
示例9: initfile
//================================================================
// Function : TexturesExt_Presentation::loadShape
// loads a shape from a given brep file from data dir into a given TopoDS_Shape object
//================================================================
Standard_Boolean TexturesExt_Presentation::loadShape(TopoDS_Shape& aShape,
TCollection_AsciiString aFileName)
{
// create a TopoDS_Shape -> read from a brep file
CString initfile(((OCC_BaseApp*) AfxGetApp())->GetInitDataDir());
initfile += "\\Data\\";
initfile += aFileName.ToCString();
TCollection_AsciiString Path((Standard_CString)(LPCTSTR)initfile);
BRep_Builder aBld;
//Standard_Boolean isRead = BRepTools::Read (aShape, aPath.ToCString(), aBld);
//if (!isRead)
// isRead = BRepTools::Read (aShape, bPath.ToCString(), aBld);
Standard_Boolean isRead = BRepTools::Read (aShape, Path.ToCString(), aBld);
if (!isRead)
{
Path += " was not found. The sample can not be shown.";
getDocument()->UpdateResultMessageDlg("Textured Shape", Path.ToCString());
return Standard_False;
}
return Standard_True;
}
示例10: nameSeq
Standard_Boolean ShHealOper_ShapeProcess::GetOperators(TColStd_SequenceOfAsciiString& theSeqOperators)
{
TCollection_AsciiString nameSeq(myPrefix);
nameSeq +=".exec.op";
if(!myOperations.Context()->ResourceManager()->Find(nameSeq.ToCString()))
return Standard_False;
TCollection_AsciiString seqoper = myOperations.Context()->ResourceManager()->Value(nameSeq.ToCString());
Standard_Integer i;
for ( i=1; ; i++ ) {
TCollection_AsciiString anOper = seqoper.Token ( " \t,;", i );
if ( anOper.Length() <=0 ) break;
theSeqOperators.Append(anOper);
}
return (theSeqOperators.Length());
}
示例11: text
void CViewer3dDoc::UpdateResultMessageDlg(CString Title, TCollection_AsciiString aMessage)
{
CString text(aMessage.ToCString());
myCResultDialog.SetText(text);
myCResultDialog.SetTitle(Title);
}
示例12: text
void OCC_3dDoc::PocessTextInDialog(char* aTitle, TCollection_AsciiString& aMessage)
{
// aMessage+= "-------------------------------- END ----------------------------------------\n";
CString text(aMessage.ToCString());
myCResultDialog.SetTitle(CString(aTitle));
myCResultDialog.SetText(text);
SetTitle(CString(aTitle));
}
示例13: removeFile
static void removeFile( const TCollection_AsciiString& fileName )
{
try {
OSD_File( fileName ).Remove();
}
catch ( Standard_ProgramError ) {
MESSAGE("Can't remove file: " << fileName.ToCString() << " ; file does not exist or permission denied");
}
}
示例14: TextToAdd
void OCC_3dDoc::AddTextInDialog(TCollection_AsciiString& aMessage)
{
CString TextToAdd(aMessage.ToCString());
CString CurrentText;
myCResultDialog.GetText(CurrentText);
CString Text;
Text = TextToAdd + CurrentText;
myCResultDialog.SetText(Text);
}
示例15: Export
STLEXPORT_EXPORT
int Export(const TopoDS_Shape& theShape,
const TCollection_AsciiString& theFileName,
const TCollection_AsciiString& theFormatName)
{
MESSAGE("Export STL into file " << theFileName.ToCString());
try
{
StlAPI_Writer aWriter;
bool aIsASCIIMode;
aIsASCIIMode = (theFormatName.IsEqual("STL_ASCII")) ? true : false;
aWriter.ASCIIMode() = aIsASCIIMode;
aWriter.Write(theShape, theFileName.ToCString()) ;
return 1;
}
catch(Standard_Failure)
{
//THROW_SALOME_CORBA_EXCEPTION("Exception catched in STLExport", SALOME::BAD_PARAM);
}
return 0;
}