当前位置: 首页>>代码示例>>C++>>正文


C++ TCollection_AsciiString::ToCString方法代码示例

本文整理汇总了C++中TCollection_AsciiString::ToCString方法的典型用法代码示例。如果您正苦于以下问题:C++ TCollection_AsciiString::ToCString方法的具体用法?C++ TCollection_AsciiString::ToCString怎么用?C++ TCollection_AsciiString::ToCString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCollection_AsciiString的用法示例。


在下文中一共展示了TCollection_AsciiString::ToCString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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;
  }
开发者ID:dbarbier,项目名称:pythonocc,代码行数:30,代码来源:ExchangeSTEP_Export.cpp

示例2: drawSurfaceAndItsBSpline

//================================================================
// 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);
}
开发者ID:jilott,项目名称:occsamplemfc,代码行数:29,代码来源:Convert_Presentation.cpp

示例3: 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;
  }
开发者ID:dbarbier,项目名称:pythonocc,代码行数:10,代码来源:ExchangeBREP_Export.cpp

示例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;
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:10,代码来源:ShHealOper_ShapeProcess.cpp

示例5: text

void CViewer3dDoc::UpdateResultMessageDlg(CString Title, TCollection_AsciiString aMessage)
{
    CString text(aMessage.ToCString());
    myCResultDialog.SetText(text);

    myCResultDialog.SetTitle(Title);
}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:7,代码来源:Viewer3dDoc.cpp

示例6: loadShape

//================================================================
// 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;
}
开发者ID:jilott,项目名称:occsamplemfc,代码行数:29,代码来源:TexturesExt_Presentation.cpp

示例7: Texturize

//////////////////////////////////////////////////////////////////////
// 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;
}
开发者ID:jilott,项目名称:occsamplemfc,代码行数:43,代码来源:TexturesExt_Presentation.cpp

示例8: 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));

}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:9,代码来源:OCC_3dDoc.cpp

示例9: 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");
  }
}
开发者ID:Daedalus12,项目名称:FreeCAD_sf_master,代码行数:9,代码来源:NETGENPlugin_Mesher.cpp

示例10: 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);

}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:12,代码来源:OCC_3dDoc.cpp

示例11: 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;
  }
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:22,代码来源:ExchangeSTL_Export.cpp

示例12: Export

SALOME_WNT_EXPORT
  int Export(const TopoDS_Shape& theShape,
			 const TCollection_AsciiString& theFileName,
			 const TCollection_AsciiString& theFormatName)
  {
	MESSAGE("Export CSFDB into file " << theFileName.ToCString());

	try
	{
		if ( theShape.IsNull() )
			return 0;

		FSD_File f;

		Handle(ShapeSchema) 	s = new ShapeSchema;
		Handle(Storage_Data) 	d = new Storage_Data;

		d->ClearErrorStatus();

		d->SetApplicationName("GEOM CSFDB PLUGIN");
		d->SetApplicationVersion("3.2.6");
		d->SetDataType("Shapes");
		d->AddToUserInfo("Saved from GEOM CSFDB Plugin");
		d->AddToComments("Based on GEOM 3.2.6 and Open CAS.CADE 6.2");

		Storage_Error err = f.Open(theFileName, Storage_VSWrite);

		if ( err != Storage_VSOk )
			return 0;

		PTColStd_TransientPersistentMap aMap;
		TCollection_AsciiString anObjectName("Object");

		Handle(PTopoDS_HShape) aPShape = MgtBRep::Translate(theShape, aMap, MgtBRep_WithTriangle);

		d->AddRoot(anObjectName, aPShape);
		s->Write( f, d);

		f.Close();

		if ( d->ErrorStatus() != Storage_VSOk )
			return 0;

		return 1;
    }
	catch(Standard_Failure)
    {
      Standard_Failure::Raise("Could not export in CSFDB format");
    }
	return 0;
  }
开发者ID:hmeyer,项目名称:salome-geom,代码行数:51,代码来源:ExchangeCSFDB_Export.cpp

示例13: drawCurveAndItsBSpline

//================================================================
// Function : Convert_Presentation::drawCurveAndItsBSpline
// Purpose  : 
//================================================================
void Convert_Presentation::drawCurveAndItsBSpline(Handle_Geom_Curve theCurve, 
                                                  const Standard_CString theName, 
                                                  TCollection_AsciiString& theText)
{
  TCollection_AsciiString aTitle ("Converting ");
  aTitle += theName;
  aTitle += " to BSpline curve";

  theText += EOL
    "  Handle_Geom_BSplineCurve aBSpline = " EOL
    "    GeomConvert::CurveToBSplineCurve(aCurve);" EOL;

  setResultTitle (aTitle.ToCString());
  setResultText (theText.ToCString());
  
  drawCurve (theCurve, CurveColor);
  
  if (WAIT_A_LITTLE) return;

  Handle_Geom_BSplineCurve aBSpline = GeomConvert::CurveToBSplineCurve(theCurve);

  drawCurve (aBSpline, BSplineColor);
}
开发者ID:jilott,项目名称:occsamplemfc,代码行数:27,代码来源:Convert_Presentation.cpp

示例14: SetOperators

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());
}
开发者ID:triggerfish1,项目名称:pythonocc,代码行数:15,代码来源:ShHealOper_ShapeProcess.cpp

示例15: ImportBREP

SALOME_WNT_EXPORT

  TopoDS_Shape ImportBREP (const TCollection_AsciiString& theFileName,
                       const TCollection_AsciiString& theFormatName,
                       TCollection_AsciiString&       theError,
		       const TDF_Label&               theLabel)
  {
    MESSAGE("Import BREP from file " << theFileName);
    TopoDS_Shape aShape;
    BRep_Builder B;
    BRepTools::Read(aShape, theFileName.ToCString(), B);
    if (aShape.IsNull()) {
      theError = "BREP Import failed";
    }
    return aShape;
  }
开发者ID:dbarbier,项目名称:pythonocc,代码行数:16,代码来源:ExchangeBREP_Import.cpp


注:本文中的TCollection_AsciiString::ToCString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。