您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ EXCEPTION1函数代码示例

51自学网 2021-06-01 20:35:55
  C++
这篇教程C++ EXCEPTION1函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中EXCEPTION1函数的典型用法代码示例。如果您正苦于以下问题:C++ EXCEPTION1函数的具体用法?C++ EXCEPTION1怎么用?C++ EXCEPTION1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: EXCEPTION2

voidavtLocateAndPickNodeQuery::SetInputParams(const MapNode &params){    if (params.HasEntry("vars"))    {        const stringVector &v = params.GetEntry("vars")->AsStringVector();        if (v.empty())            EXCEPTION2(QueryArgumentException, "vars", 1);        timeCurveSpecs["nResultsToStore"] = (int)v.size();        pickAtts.SetVariables(v);    }    else        EXCEPTION1(QueryArgumentException, "vars");    if (params.HasNumericVectorEntry("ray_start_point"))    {        doubleVector v;        params.GetEntry("ray_start_point")->ToDoubleVector(v);        if (v.size() != 3)            EXCEPTION2(QueryArgumentException, "ray_start_point", 3);        pickAtts.SetRayPoint1(v);    }    else        EXCEPTION1(QueryArgumentException, "ray_start_point");    if (params.HasNumericVectorEntry("ray_end_point"))    {        doubleVector v;        params.GetEntry("ray_end_point")->ToDoubleVector(v);        if (v.size() != 3)            EXCEPTION2(QueryArgumentException, "ray_end_point", 3);        pickAtts.SetRayPoint2(v);    }    else        EXCEPTION1(QueryArgumentException, "ray_end_point");    if (params.HasNumericEntry("domain"))        domain = params.GetEntry("domain")->ToInt();    else        EXCEPTION1(QueryArgumentException, "domain");    if (params.HasNumericEntry("element"))        node = params.GetEntry("element")->ToInt();    else        EXCEPTION1(QueryArgumentException, "element");}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:46,


示例2: switch

voidVisitHotPointInteractor::Start2DMode(INTERACTION_MODE mode){    if(!proxy.HasPlots())    {        return;    }    VisitInteractor  *newInteractor  = NULL;    switch(mode)    {    case NAVIGATE:        if(navigate2D == NULL)        {            navigate2D = new Navigate2D(proxy);        }        newInteractor = navigate2D;        break;    case NODE_PICK:    case ZONE_PICK:    case SPREADSHEET_PICK:    case DDT_PICK:        if(pick == NULL)        {            pick = new Pick(proxy);        }        newInteractor = pick;        break;    case ZOOM:        if(zoom2D == NULL)        {            zoom2D = new Zoom2D(proxy);        }        newInteractor = zoom2D;        break;    case LINEOUT:        if(lineout2D == NULL)        {            lineout2D = new Lineout2D(proxy);        }        newInteractor = lineout2D;        break;    }    if(newInteractor == NULL)    {        //        // We have an invalid navigation mode or an invalid window mode.        //        EXCEPTION1(BadInteractorException, mode);    }    //    // No reason to set the interactor again if it is the same one.    //    if(newInteractor != currentInteractor)        SetInteractor(newInteractor);}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:58,


示例3: FinalizeTimeLoop

voidavtTimeIteratorExpression::Execute(void){    FinalizeTimeLoop();    avtContract_p contract = ConstructContractWithVarnames();    contract->DisableExtentsCalculations();    // Store off the original expression list.    ParsingExprList *pel = ParsingExprList::Instance();    ExpressionList orig_list = *(pel->GetList());    InitializeOutput();    std::string db = GetInput()->GetInfo().GetAttributes().GetFullDBName();    ref_ptr<avtDatabase> dbp = avtCallback::GetDatabase(db, 0, NULL);    if (*dbp == NULL)        EXCEPTION1(InvalidFilesException, db.c_str());    // The first EEF already set up its expressions ... we need a new one    // to set up filters for the CMFE expressions.    avtExpressionEvaluatorFilter myeef;    myeef.SetInput(GetInput());    for (int i = 0 ; i < numTimeSlicesToProcess ; i++)    {        int timeSlice = firstTimeSlice + i*timeStride;        if (timeSlice > actualLastTimeSlice)            timeSlice = actualLastTimeSlice;        debug1 << "Time iterating expression working on time slice "                << timeSlice << endl;        UpdateExpressions(timeSlice);        // won't re-execute without setting modified to true, because        // it doesn't check to see if expression definitions change.        myeef.ReleaseData();        myeef.GetOutput()->Update(contract);        avtCallback::ResetTimeout(5*60);        Barrier();        avtCallback::ResetTimeout(5*60);        avtDatabaseMetaData *md = dbp->GetMetaData(timeSlice, false,                                                   false, false);        currentCycle = md->GetCycles()[timeSlice];        currentTime  = md->GetTimes()[timeSlice];        ProcessDataTree(myeef.GetTypedOutput()->GetDataTree(), i);        debug1 << "Time iterating expression done working on time slice "                << timeSlice << endl;    }    // Get the upstream filters back the way they are supposed to be.    GetInput()->Update(executionContract);    FinalizeOutput();    // Restore the original expression list ... i.e. undo the temporary    // expressions we put in.    *(pel->GetList()) = orig_list;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:57,


示例4: switch

vtkDataArray *ADIOSFileObject::AllocateArray(ADIOS_DATATYPES &t){    vtkDataArray *array = NULL;    switch (t)    {      case adios_unsigned_byte:        array = vtkCharArray::New();        break;      case adios_byte:        array = vtkUnsignedCharArray::New();        break;      case adios_string:        array = vtkCharArray::New();        break;              case adios_unsigned_short:        array = vtkUnsignedShortArray::New();        break;      case adios_short:        array = vtkShortArray::New();        break;              case adios_unsigned_integer:        array = vtkUnsignedIntArray::New();         break;      case adios_integer:        array = vtkIntArray::New();         break;              case adios_unsigned_long:        array = vtkUnsignedLongArray::New();         break;      case adios_long:        array = vtkLongArray::New();         break;              case adios_real:        array = vtkFloatArray::New();         break;              case adios_double:        array = vtkDoubleArray::New();         break;              case adios_long_double: // 16 bytes      case adios_complex:     //  8 bytes      case adios_double_complex: // 16 bytes      default:        std::string str = "Inavlid variable type";        EXCEPTION1(InvalidVariableException, str);        break;    }    return array;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:56,


示例5: ds

avtIVPVTKTimeVaryingField::avtIVPVTKTimeVaryingField( vtkDataSet* dataset,                                                       avtCellLocator* locator,                                                      double _t0, double _t1 )   : ds(dataset), loc(locator), t0(_t0), t1(_t1), dt(_t1-_t0){    if( ds )        ds->Register( NULL );    if( (velData[0] = ds->GetPointData()->GetVectors()) )    {        velCellBased = false;        velData[1] = ds->GetPointData()->GetArray( NextTimePrefix );    }    else if( (velData[0] = ds->GetCellData()->GetVectors()) )    {        velCellBased = true;        velData[1] = ds->GetCellData()->GetArray( NextTimePrefix );    }    else     {        velData[0] = velData[1] = NULL;        EXCEPTION1( ImproperUseException,                     "avtIVPVTKTimeVaryingField: Can't locate vectors to interpolate." );    }    if( velData[1] == NULL )    {        EXCEPTION1( ImproperUseException,                     "avtIVPVTKTimeVaryingField: Can't locate second pair of vectors to interpolate." );    }    lastCell = -1;    lastPos.x = lastPos.y = lastPos.z =        std::numeric_limits<double>::quiet_NaN();    std::fill( sclData[0], sclData[0]+256, (vtkDataArray*)NULL );    std::fill( sclData[1], sclData[1]+256, (vtkDataArray*)NULL );    std::fill( sclCellBased, sclCellBased+256, false );    sclDataName.resize( 256 );}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:43,


示例6: EXCEPTION1

voidavtLineScanQuery::PreExecute(void){    avtDatasetQuery::PreExecute();    if (numBins <= 0)    {        EXCEPTION1(VisItException, "There must be at least one bin.");    }    if (numLines <= 0)    {        EXCEPTION1(VisItException, "There must be at least one line.");    }    if (minLength < 0 || maxLength <= minLength)    {        EXCEPTION1(VisItException, "The min length must be less than the max "                        "length and they both must be positive.");    }}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:19,


示例7: GetInput

voidavtExecuteThenTimeLoopFilter::FinalizeTimeLoop(){    int numStates = GetInput()->GetInfo().GetAttributes().GetNumStates();    if (startTime < 0)    {        startTime = 0;    }    if (endTime < 0)    {        endTime = numStates - 1;    }    if (stride < 0)    {        stride = 1;    }    if (startTime > endTime)    {        std::string msg("Start time must be smaller than or equal to the end time for " );        msg += GetType();        msg += "./n";        EXCEPTION1(ImproperUseException, msg);    }    nFrames = (int) ceil((((float)endTime-startTime))/(float)stride) + 1;     // ARS - This check will always pass because of the additional    // frame added to nFrames above and startTime must be greater than    // or equal to endTime. Thus it is commented out.//     if (nFrames < 1)//     {//         std::string msg(GetType());//         msg = msg +  " requires at least 1 frame, please correct start " + //                "and end times and try again.";//         EXCEPTION1(ImproperUseException, msg);//    }    if (endTime >= numStates)    {        std::string msg(GetType());        msg += ":  Clamping end time to number of available timesteps.";        avtCallback::IssueWarning(msg.c_str());    }    //    // Ensure that the specified endTime is included,    // regardless of the stride.    //    actualEnd = startTime + nFrames * stride;    if (actualEnd < endTime)        actualEnd = endTime + stride;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:55,


示例8: sprintf

voidavtGTCFileFormat::BinData( int dim, parallelBuffer **array, float *vars, float *ids,                            float **myVarsPtr, float **myIdsPtr ){    int ptCnt = nTotalPoints / nProcs;    int remainder = nTotalPoints % nProcs;    float *ptrIDs = ids, *ptrVars = vars, *myVars = *myVarsPtr, *myIds = *myIdsPtr;    float *data = new float[dim+1];        for ( int i = 0; i < nPoints; i++ )    {        int id = ((int) *ptrIDs) - 1; //Make the id 0...N-1 for the math below.        int whichProc;        // Determine which processor this ID goes to.        if ( id < (remainder * (ptCnt+1)) )            whichProc = id / (ptCnt+1);        else        {            int id2 = id - (remainder * (ptCnt+1));            whichProc = remainder + id2/ptCnt;        }        if ( whichProc < 0 || whichProc >= nProcs )        {            char str[512];            sprintf( str, "Bad Id mapping: %d ==> %d/n", id, whichProc );            EXCEPTION1( InvalidDBTypeException, str );        }        // This is our data, so copy it to the front of the var, ids arrays.        if ( whichProc == rank )        {            // ID            *myIds++ = *ptrIDs++;            for ( int j = 0; j < dim; j++ )                *myVars++ = *ptrVars++;        }        // This data isn't ours. Stash it in the buffer to be sent.                else           {            // ID            data[0] = *ptrIDs++;            for ( int j = 0; j < dim; j++ )                data[j+1] = *ptrVars++;            array[whichProc]->Add( data );        }    }        delete [] data;    *myIdsPtr = myIds;    *myVarsPtr = myVars;}
开发者ID:EricAlex,项目名称:ThirdParty-dev,代码行数:55,


示例9: Initialize

vtkDataArray *avtADIOSBasicFileFormat::GetVar(int timestate, int domain, const char *varname){    debug1 << "avtADIOSBasicFileFormat::GetVar " << varname << endl;    Initialize();    vtkFloatArray *arr = NULL;    if (! fileObj->ReadVariable(varname, timestate, &arr))        EXCEPTION1(InvalidVariableException, varname);            return arr;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:11,


示例10: EXCEPTION1

OperatorPluginManager *ViewerProxy::GetOperatorPluginManager() const{    if(operatorPlugins == 0)    {        EXCEPTION1(ImproperUseException, "ViewerProxy::InitializePlugins "            "must be called before ViewerProxy::GetOperatorPluginManager");    }    return operatorPlugins;}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:11,


示例11: VASP_CreateFileFormatInterface

avtFileFormatInterface *VASP_CreateFileFormatInterface(const char * const *list, int nList, int nBlock){    avtFileFormatInterface *ffi = 0;    if (list != 0 && nList > 0)    {        // Determine the type of reader that we want to use.        int flavor = -1;        TRY        {            std::string fn(list[0]);            if(flavor == -1 && avtOUTCARFileFormat::Identify(fn))            {                flavor = 0;                debug4 << "Database is avtOUTCARFileFormat" << endl;            }            if(flavor == -1 && avtCHGCARFileFormat::Identify(fn))            {                flavor = 1;                debug4 << "Database is avtCHGCARFileFormat" << endl;            }            if(flavor == -1 && avtPOSCARFileFormat::Identify(fn))            {                flavor = 2;                debug4 << "Database is avtPOSCARFileFormat" << endl;            }            if(flavor == -1)            {                EXCEPTION1(InvalidFilesException, list[0]);            }        }        CATCH(VisItException)        {            RETHROW;        }        ENDTRY        switch(flavor)        {          case 0:            ffi = avtOUTCARFileFormat::CreateInterface(list, nList, nBlock);            break;          case 1:            ffi = avtCHGCARFileFormat::CreateInterface(list, nList, nBlock);            break;          case 2:            ffi = avtPOSCARFileFormat::CreateInterface(list, nList, nBlock);            break;        }    }
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:54,


示例12: if

voidavtIVPVTKTimeVaryingField::SetScalarVariable(unsigned char index, const std::string& name){    vtkDataArray* data[2] = { NULL, NULL };    bool cellBased;    if( (data[0] = ds->GetPointData()->GetScalars( name.c_str() )) )    {        cellBased = false;        data[1] =             ds->GetPointData()->GetArray( (NextTimePrefix+name).c_str() );    }    else if( (data[0] = ds->GetCellData()->GetScalars( name.c_str() )) )    {        cellBased = true;        data[1] =             ds->GetCellData()->GetArray( (NextTimePrefix+name).c_str() );    }    else        EXCEPTION1( ImproperUseException,                     "avtIVPVTKTimeVaryingField: Can't locate scalar /"" + name +                     "/" to interpolate." );/* TODO. not sure we want all data to have a second value    if( data[1] == NULL )        EXCEPTION1( ImproperUseException,                     "avtIVPVTKTimeVaryingField: Can't locate next scalar /"" + name +                     "/" to interpolate." );*/    if( data[0]->GetNumberOfComponents() != 1 ||         (data[1] && data[1]->GetNumberOfComponents() != 1) )        EXCEPTION1( ImproperUseException,                    "avtIVPVTKTimeVaryingField: Given variable /"" + name +                    "/" is not scalar." );            sclDataName[index] = name;    sclData[0][index] = data[0];    sclData[1][index] = data[1];    sclCellBased[index] = cellBased;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:41,


示例13: strlen

voidavtFluxFilter::InferVariableNameFromContract(avtContract_p c){    avtDataRequest_p in_dr = c->GetDataRequest();    bool foundIt = false;    if (strncmp(in_dr->GetVariable(), "operators/Flux/",                strlen("operators/Flux/")) == 0)    {        foundIt = true;        if (atts.GetFlowField() == "default")        {             EXCEPTION1(VisItException, "You can't set the flow field as /"default/" "                        "since the default field is not a vector.");        }        if (atts.GetWeight() && atts.GetWeightField() == "default")        {             EXCEPTION1(VisItException, "You can't set the weighting field as /"default/" "                        "since that would lead to a recursive definition.");        }        varname = in_dr->GetVariable()+strlen("operators/Flux/");    }    if (!foundIt)    {        std::vector<CharStrRef>   vars2nd = in_dr->GetSecondaryVariablesWithoutDuplicates();        for (size_t i = 0 ; i < vars2nd.size() ; i++)        if (strncmp(*(vars2nd[i]), "operators/Flux/",                    strlen("operators/Flux/")) == 0)        {            foundIt = true;            varname = *(vars2nd[i])+strlen("operators/Flux/");        }    }    if (!foundIt)    {        EXCEPTION1(VisItException, "Unable to determine variable name from contract");    }}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:40,


示例14: EXCEPTION1

void avtShapeletDecompositionQuery::SetInputParams(const MapNode & params){    if (params.HasNumericEntry("beta"))    {        double b = params.GetEntry("beta")->ToDouble();        if (b < 1.0)        {            EXCEPTION1(VisItException, "Shapelet Decomposition requires "                       "beta and nmax >= 1.");        }        SetBeta(b);    }    else    {        SetBeta(1.0);    }    if (params.HasNumericEntry("nmax"))    {        int m = params.GetEntry("nmax")->ToInt();        SetNMax(m < 1 ? 1 : m);    }     SetDecompOutputFileName("");    if (params.HasEntry("recomp_file"))    {        std::string rf(params.GetEntry("recomp_file")->AsString());        if (rf.empty())        {            EXCEPTION1(QueryArgumentException, "recomp_file");        }        SetRecompOutputFileName(rf);    }    else     {        SetRecompOutputFileName("");    }}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:40,


示例15: avtCellLocator

avtCellLocatorRect::avtCellLocatorRect( vtkDataSet* ds ) :    avtCellLocator( ds ){    vtkRectilinearGrid* rg = vtkRectilinearGrid::SafeDownCast( dataSet );    if( dataSet->GetDataObjectType() != VTK_RECTILINEAR_GRID || rg == NULL )        EXCEPTION1( ImproperUseException, "avtCellLocatorRect: Dataset is not rectilinear." );    // copy the coordinate arrays for faster access later    vtkDataArray* ca[3] = {         rg->GetXCoordinates(),        rg->GetYCoordinates(),        rg->GetZCoordinates(),    };    for( unsigned int d=0; d<3; ++d )    {        coord[d].resize( ca[d]->GetNumberOfTuples() );        ascending[d] = true;        for( unsigned int i=0; i<coord[d].size(); ++i )        {            coord[d][i] = ca[d]->GetComponent( i, 0 );            if (i == 1)            {               if (coord[d][1] < coord[d][0])                   ascending[d] = false;            }            else if (i > 1)            {                bool thisPairAscending = (coord[d][i] > coord[d][i-1]);                if (thisPairAscending != ascending[d])                {                    EXCEPTION1( ImproperUseException, "avtCellLocatorRect: Coordinate "                       "arrays are not monotonic.");                }            }        }    }    }
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:40,


示例16: adios_gopen_byid

voidADIOSFileObject::OpenGroup(int grpIdx){    if (!gps)        return;    if (gps[grpIdx] == NULL)        gps[grpIdx] = adios_gopen_byid(fp, grpIdx);    if (gps[grpIdx] == NULL)    {        std::string errmsg = "Error opening group "+std::string(fp->group_namelist[grpIdx])+" in " + fileName;        EXCEPTION1(InvalidDBTypeException, errmsg.c_str());    }}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:14,


示例17: EXCEPTION1

intavtScalarMetaData::AddEnumNameRange(std::string name, double min, double max){    if (min > max)    {        EXCEPTION1(ImproperUseException, name);    }    enumNames.push_back(name);    enumRanges.push_back(min);    enumRanges.push_back(max);    return enumNames.size() - 1;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:14,


示例18: EXCEPTION1

voidavtRayCompositer::InsertOpaqueImage(avtImage_p img){    avtImageRepresentation &rep = img->GetImage();    if (rep.GetZBuffer() == NULL)    {        //        // How can we incorporate an image if it has no zbuffer?        //        EXCEPTION1(ImproperUseException, "Need Z buffer.");    }    opaqueImage = img;}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:14,


示例19: t0

voidavtNamedSelectionManager::CreateNamedSelection(avtDataObject_p dob,     const SelectionProperties &selProps, avtNamedSelectionExtension *ext){    const char *mName = "avtNamedSelectionManager::CreateNamedSelection: ";    StackTimer t0("CreateNamedSelection");    if (strcmp(dob->GetType(), "avtDataset") != 0)    {        EXCEPTION1(VisItException, "Named selections only work on data sets");    }    // Save the selection properties.    AddSelectionProperties(selProps);    // Augment the contract based on the selection properties.    avtContract_p c0 = dob->GetContractFromPreviousExecution();    bool needsUpdate = false;    avtContract_p contract = ext->ModifyContract(c0, selProps, needsUpdate);    //     // Let the input try to create the named selection ... some have special    // logic, for example the parallel coordinates filter.    //    const std::string &selName = selProps.GetName();    avtNamedSelection *ns = NULL;    if(selProps.GetSelectionType() == SelectionProperties::BasicSelection)    {        ns = dob->GetSource()->CreateNamedSelection(contract, selName);        if (ns != NULL)        {            int curSize = selList.size();            selList.resize(curSize+1);            selList[curSize] = ns;            //            // Save out the named selection in case of engine crash /             // save/restore session, etc.            //              SaveNamedSelection(selName, true);            return;        }    }    //    // Call into the extension to get the per-processor named selection.    //    TimedCodeBlock("Creating selection in extension",        ns = ext->GetSelection(dob, selProps, cache);    );
开发者ID:EricAlex,项目名称:ThirdParty-dev,代码行数:50,


示例20: Initialize

vtkDataArray *avtMM5FileFormat::GetVar(int timestate, const char *varname){    mm5_fieldinfo_t *field = 0;    Initialize();       if(mm5file == 0)    {        EXCEPTION1(InvalidVariableException, varname);    }    field = mm5_file_find_field(mm5file, varname, timestate);    if(field == 0)    {        EXCEPTION1(InvalidVariableException, varname);    }    // Set up the return array.    vtkFloatArray *rv = vtkFloatArray::New();    int n_elements = field->header.end_index[0] *            field->header.end_index[1] *            field->header.end_index[2] *            field->header.end_index[3];    rv->SetNumberOfTuples(n_elements);    float *fptr = (float *)rv->GetVoidPointer(0);    // Read the data directly into the array.    if(mm5_file_read_field(mm5file, varname, timestate, fptr) == 0)    {        rv->Delete();        EXCEPTION1(InvalidVariableException, varname);    }    return rv;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:37,


示例21: EXCEPTION1

// ****************************************************************************//  Method: avtConnComponentsLengthQuery::Execute////  Purpose://      Processes a single input domain to update the per component area sums.////  Arguments://      ds       Input dataset//      dom      Input domain number////  Programmer: Cyrus Harrison//  Creation:   Wed Jun 15 13:09:43 PDT 2011//// ****************************************************************************voidavtConnComponentsLengthQuery::Execute(vtkDataSet *ds, const int dom){    // get the number of cells to process    int ncells = ds->GetNumberOfCells();    // get the component labels and volume arrays    vtkIntArray  *labels =(vtkIntArray*)ds->GetCellData()->GetArray("avt_ccl");    vtkDataArray *vol= ds->GetCellData()->GetArray("avt_weight");    // make sure the volume and component label arrays are valid    if (vol == NULL)    {        EXCEPTION1(InvalidVariableException, "avt_weight");    }    if (labels == NULL)    {        EXCEPTION1(InvalidVariableException, "avt_ccl");    }    double len_val = 0.0;    // loop over all cells    for (int i = 0 ; i < ncells ; i++)    {        // get the cell  & and its component label        vtkCell *cell    = ds->GetCell(i);        int      comp_id = labels->GetValue(i);        // get cell area        len_val = (double) vol->GetTuple1(i);        // add to total component area        lengthPerComp[comp_id] += len_val;    }}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:50,


示例22: avtMTSDFileFormat

/** Method: avtGGCM constructor *  Programmer: tfogal -- generated by xml2avt *  Creation:   Thu Jun 1 13:38:54 PST 2006 */avtGGCMFileFormat::avtGGCMFileFormat(const char *filename,                                     DBOptionsAttributes *db)                       : avtMTSDFileFormat(&filename, 1){    assert(filename != NULL);    DeriveGridFile(filename, &this->fn_grid);    if(this->fn_grid == NULL)    {        EXCEPTION1(InvalidDBTypeException, "Could not derive grid filename.");    }    this->selList.clear();    this->selsApplied = NULL;    this->restricted = false;}
开发者ID:EricAlex,项目名称:ThirdParty-dev,代码行数:19,


示例23: adios_gclose

voidADIOSFileObject::CloseGroup(int grpIdx){    if (!gps)        return;    if (gps[grpIdx] != NULL)    {        int val = adios_gclose(gps[grpIdx]);        gps[grpIdx] = NULL;        if (val != 0)        {            std::string errmsg = "Error closing group "+std::string(fp->group_namelist[grpIdx])+" in " + fileName;            EXCEPTION1(InvalidDBTypeException, errmsg.c_str());        }    }}
开发者ID:HarinarayanKrishnan,项目名称:VisIt26RC_Trunk,代码行数:16,


示例24: MPI_Allgather

int *avtGTCFileFormat::GetDataShareMatrix( parallelBuffer **array ){    // Binning done, now tell everyone else how many particles we have for them.    int *particleCnts = new int[nProcs], *gatherCnts = new int[nProcs*nProcs];        for ( int i = 0; i < nProcs; i++ )        particleCnts[i] = array[i]->Size();    // Allgather is a little overkill, but there isn't much data.    int err = MPI_Allgather( particleCnts, nProcs, MPI_INT,                             gatherCnts, nProcs*nProcs, MPI_INT, VISIT_MPI_COMM );    if ( err != MPI_SUCCESS )        EXCEPTION1(InvalidDBTypeException, "GTC Reader: MPI_Allgather() failure." );        return gatherCnts;}
开发者ID:EricAlex,项目名称:ThirdParty-dev,代码行数:17,


示例25: EXCEPTION1

avtCellList *avtSamplePoints::GetCellList(void){    if (varnames.size() <= 0)    {        EXCEPTION1(VisItException,             "Degenerate case: asked to resample a data set with no variables."            "  This has not been implemented.");    }    if (celllist == NULL)    {        celllist = new avtCellList(GetNumberOfVariables());    }    return celllist;}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:17,


示例26: GetDocument

AdvDocument *GetDocument(AdvDocFile *f, const std::string &var){    AdvDocument *doc = adv_dio_open_by_property(f, 0,         "content_type", "HDDM_FEGenericAttribute",        "label", var.c_str(), 0);    if(doc == 0)    {        doc = adv_dio_open_by_property(f, 0,             "content_type", "FEGenericAttribute",            "label", var.c_str(), 0);    }    if(doc == 0)    {        EXCEPTION1(InvalidVariableException, var.c_str());    }    return doc;}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:18,



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


C++ EXCEPTION_CONVERT函数代码示例
C++ EXCEPTION0函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。