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


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

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


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

示例1: 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);
}
开发者ID:NLxjtu,项目名称:McCad,代码行数:12,代码来源:main.cpp

示例2: 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;
}
开发者ID:NLxjtu,项目名称:McCad,代码行数:14,代码来源:main.cpp

示例3: main

// MAIN
//////////////////////
int main(int argc, char *argv[]) {
    // define messenger system
    McCadMessenger_Singleton *msgr = McCadMessenger_Singleton::Instance();
    McCadMessenger_ObserverInterface* stdCoutObserver = new McCadMessenger_StdOut;
    msgr->Register(stdCoutObserver);

    // define plugin path
    char* pLibPath = getenv("MCCAD_LIBDIR");
    OSD_Path pluginPath("empty");
    if (pLibPath == NULL) {
        cout << "MCCAD_LIBDIR is not defined!!! " << endl;
        return 1;
    }
    else
        pluginPath = OSD_Path(pLibPath);

    // load plugins
    McCadEXPlug_PluginManager* pluginManager = McCadEXPlug_PluginManager::Instance();
    pluginManager->LoadSharedLibrary(pluginPath);

    // handle input parameters
    TCollection_AsciiString Prog = argv[0];
    if(argc > 4 ) {
        string arg3(argv[3]), arg4(argv[4]);
        if(arg3 == ">" || arg3 == ">>") {
            argc = 3;
        }
        else if(arg4 == ">" || arg4 == ">>") {
            argc = 4;
        }
        else {
            printUsage(Prog);
            exit(0);
        }
    }
    bool openFile = false;

    // handle input
    TCollection_AsciiString inName;
 if(argc > 1)

//if (1)
   {
        TCollection_AsciiString inParameter;
        inParameter = argv[1];
        if(argc > 2)
            inName = argv[2];
        TCollection_AsciiString outputName;        
        TCollection_AsciiString strMatName = "";
        if (argc > 3)
            strMatName = argv[3];
        if(inParameter.IsEqual("-h") || inParameter.IsEqual("--help")) {
            printUsage();
            exit(0);
        }

        /* test code */
        //inParameter = "-m";
        TCollection_AsciiString config_file = "McCadConfig.txt";
        //inName = "convertedTest.stp";
        //strMatName = "material.xml";
        /* test code */

        // Expander
        if(inParameter.IsEqual("-e") || inParameter.IsEqual("--explode")) {
            cout << "\nMcCad_Exploder\n====================\n\n";
            Handle_TopTools_HSequenceOfShape inputShapes = readFile( inName );
            McCadIOHelper_Expander expander(inputShapes);
            Handle_TopTools_HSequenceOfShape expandedFiles = expander.GetExplodedShapes();
            if(expandedFiles->Length() < 2){
                TCollection_AsciiString message("Failed to expand file : ");
                message.AssignCat(inName);
                msgr->Message(message.ToCString());
                exit(0);
            }
            TCollection_AsciiString tmpName(inName);
            TCollection_AsciiString fileFilter = tmpName.Split( tmpName.SearchFromEnd(".") -1 );
            for(int i=1; i<=expandedFiles->Length(); i++){
                TCollection_AsciiString outName(tmpName);
                outName.Prepend("ExOut");
                outName.AssignCat("_");
                outName.AssignCat(i);
                outName.AssignCat(fileFilter);
                Handle_TopTools_HSequenceOfShape singleShape = new TopTools_HSequenceOfShape;
                singleShape->Append(expandedFiles->Value(i));
                writeFile(outName, singleShape);
            }
        }

        // Convertor
        else if(inParameter.IsEqual("-d") || inParameter.IsEqual("--decompose")) {
            cout << "\nMcCad_Decomposer\n====================\n\n";
            // read file
            Handle_TopTools_HSequenceOfShape inputShapes = readFile( inName );

            // decompose geometry
            McCadConvertTools_Convertor convertor(inputShapes);
            convertor.Convert();
//.........这里部分代码省略.........
开发者ID:NLxjtu,项目名称:McCad,代码行数:101,代码来源:main.cpp


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