这篇教程C++ Get_System函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中Get_System函数的典型用法代码示例。如果您正苦于以下问题:C++ Get_System函数的具体用法?C++ Get_System怎么用?C++ Get_System使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了Get_System函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Get_System//---------------------------------------------------------double CGrid_Gaps::Tension_Change(int x, int y, int iStep){ int i, ix, iy; double n, d, dz; for(i=0, d=0.0, n=0.0; i<8; i++) { ix = x + iStep * Get_System()->Get_xTo(i); iy = y + iStep * Get_System()->Get_yTo(i); if( pResult->is_InGrid(ix, iy) ) { dz = 1.0 / Get_System()->Get_UnitLength(i); d += dz * pResult->asDouble(ix, iy); n += dz; } } if( n > 0.0 ) { d /= n; return( d ); } return( pResult->asDouble(x, y) );}
开发者ID:sina-masoud-ansari,项目名称:saga-gis,代码行数:29,
示例2: Construct_Object*/ void Init_Errors(REBVAL *errors)/************************************************************************/{ REBSER *errs; REBVAL *val; // Create error objects and error type objects: *ROOT_ERROBJ = *Get_System(SYS_STANDARD, STD_ERROR); errs = Construct_Object(0, VAL_BLK(errors), 0); Set_Object(Get_System(SYS_CATALOG, CAT_ERRORS), errs); Set_Root_Series(TASK_ERR_TEMPS, Make_Block(3)); // Create objects for all error types: for (val = BLK_SKIP(errs, 1); NOT_END(val); val++) { errs = Construct_Object(0, VAL_BLK(val), 0); SET_OBJECT(val, errs); } // Catch top level errors, to provide decent output: PUSH_STATE(Top_State, Saved_State); if (SET_JUMP(Top_State)) { POP_STATE(Top_State, Saved_State); DSP++; // Room for return value Catch_Error(DS_TOP); // Stores error value here Print_Value(DS_TOP, 0, FALSE); Crash(RP_NO_CATCH); } SET_STATE(Top_State, Saved_State);}
开发者ID:51weekend,项目名称:r3,代码行数:31,
示例3: Parameters//---------------------------------------------------------bool CFilter_Resample::On_Execute(void){ double Cellsize; CSG_Grid *pGrid, *pLoPass, *pHiPass; //----------------------------------------------------- pGrid = Parameters("GRID" )->asGrid(); pLoPass = Parameters("LOPASS")->asGrid(); pHiPass = Parameters("HIPASS")->asGrid(); Cellsize = Parameters("SCALE" )->asDouble() * Get_Cellsize(); //----------------------------------------------------- if( Cellsize > 0.5 * SG_Get_Length(Get_System()->Get_XRange(), Get_System()->Get_YRange()) ) { Error_Set(_TL("resampling cell size is too large")); return( false ); } //----------------------------------------------------- CSG_Grid Grid(CSG_Grid_System(Cellsize, Get_XMin(), Get_YMin(), Get_XMax(), Get_YMax()), SG_DATATYPE_Float); Grid.Assign(pGrid, GRID_RESAMPLING_Mean_Cells); //----------------------------------------------------- pLoPass->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pGrid->Get_Name(), _TL("Low Pass"))); pHiPass->Set_Name(CSG_String::Format(SG_T("%s [%s]"), pGrid->Get_Name(), _TL("High Pass"))); CSG_Colors Colors; DataObject_Get_Colors(pGrid , Colors); DataObject_Set_Colors(pLoPass, Colors); DataObject_Set_Colors(pHiPass, 11, SG_COLORS_RED_GREY_BLUE); //----------------------------------------------------- for(int y=0; y<Get_NY() && Set_Progress(y); y++) { double py = Get_YMin() + y * Get_Cellsize(); #pragma omp parallel for for(int x=0; x<Get_NX(); x++) { double z, px = Get_XMin() + x * Get_Cellsize(); if( !pGrid->is_NoData(x, y) && Grid.Get_Value(px, py, z) ) { pLoPass->Set_Value(x, y, z); pHiPass->Set_Value(x, y, pGrid->asDouble(x, y) - z); } else { pLoPass->Set_NoData(x, y); pHiPass->Set_NoData(x, y); } } } //----------------------------------------------------- return( true );}
开发者ID:Fooway,项目名称:SAGA-GIS-git-mirror,代码行数:61,
示例4: return//---------------------------------------------------------bool CSG_Module_Grid::Set_Progress_NCells(int iCell){ if( Get_System()->is_Valid() && (Get_System()->Get_NCells() <= 100 || !(iCell % (Get_System()->Get_NCells() / 100))) ) { return( CSG_Module::Set_Progress(iCell, Get_System()->Get_NCells()) ); } return( is_Progress() );}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:10,
示例5: return//---------------------------------------------------------bool CSG_Module_Grid::Set_Progress_NCells(sLong iCell){ if( Get_System()->is_Valid() ) { return( CSG_Module::Set_Progress((double)iCell, (double)Get_System()->Get_NCells()) ); } return( is_Progress() );}
开发者ID:Fooway,项目名称:SAGA-GIS-git-mirror,代码行数:10,
示例6: pow//---------------------------------------------------------bool CKinWav_D8::Initialize(double Roughness){ m_Flow_Last .Create(*Get_System(), SG_DATATYPE_Float); m_Alpha .Create(*Get_System(), SG_DATATYPE_Float); m_Direction .Create(*Get_System(), SG_DATATYPE_Char); m_Direction .Set_NoData_Value(-1); m_pFlow->Assign(0.0); DataObject_Set_Colors(m_pFlow, 100, SG_COLORS_WHITE_BLUE); DataObject_Update(m_pFlow, 0.0, 100.0, SG_UI_DATAOBJECT_SHOW); //----------------------------------------------------- for(int y=0; y<Get_NY() && Set_Progress(y); y++) { for(int x=0; x<Get_NX(); x++) { if( !m_pDEM->is_NoData(x, y) ) { int i, ix, iy, iMax; double z, d, dMax; for(i=0, iMax=-1, dMax=0.0, z=m_pDEM->asDouble(x, y); i<8; i++) { ix = Get_xTo(i, x); iy = Get_yTo(i, y); if( is_InGrid(ix, iy) && (d = (z - m_pDEM->asDouble(ix, iy)) / Get_Length(i)) > dMax ) { dMax = d; iMax = i; } } if( iMax < 0 ) { m_Direction .Set_NoData(x, y); } else { m_Direction .Set_Value(x, y, iMax); m_Alpha .Set_Value(x, y, pow(Roughness / sqrt(dMax), Beta_0)); if( m_Alpha.asDouble(x, y) > 10 ) m_Alpha.Set_Value(x, y, 10); } } } } return( true );}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:53,
示例7: Get_System*/ REBVAL *Find_Last_Event (REBINT model, REBINT type)/*** Find the last event in the queue by the model** Check its type, if it matches, then return the event or NULL***************************************************************************/{ REBVAL *port; REBVAL *value; REBVAL *state; port = Get_System(SYS_PORTS, PORTS_SYSTEM); if (!IS_PORT(port)) return NULL; // verify it is a port object // Get queue block: state = VAL_OBJ_VALUE(port, STD_PORT_STATE); if (!IS_BLOCK(state)) return NULL; for (value = VAL_BLK_TAIL(state) - 1; value >= VAL_BLK(state); -- value) { if (VAL_EVENT_MODEL(value) == model) { if (VAL_EVENT_TYPE(value) == type) { return value; } else { return NULL; } } } return NULL;}
开发者ID:mbk,项目名称:ren-c,代码行数:30,
示例8: VAL_OBJ_FRAME*/ REBVAL *Find_Error_Info(ERROR_OBJ *error, REBINT *num)/*** Return the error message needed to print an error.** Must scan the error catalog and its error lists.** Note that the error type and id words no longer need** to be bound to the error catalog context.** If the message is not found, return null.*************************************************************************/{ REBSER *frame; REBVAL *obj1; REBVAL *obj2; if (!IS_WORD(&error->type) || !IS_WORD(&error->id)) return 0; // Find the correct error type object in the catalog: frame = VAL_OBJ_FRAME(Get_System(SYS_CATALOG, CAT_ERRORS)); obj1 = Find_Word_Value(frame, VAL_WORD_SYM(&error->type)); if (!obj1) return 0; // Now find the correct error message for that type: frame = VAL_OBJ_FRAME(obj1); obj2 = Find_Word_Value(frame, VAL_WORD_SYM(&error->id)); if (!obj2) return 0; if (num) { obj1 = Find_Word_Value(frame, SYM_CODE); *num = VAL_INT32(obj1) + Find_Word_Index(frame, VAL_WORD_SYM(&error->id), FALSE) - Find_Word_Index(frame, SYM_TYPE, FALSE) - 1; } return obj2;}
开发者ID:51weekend,项目名称:r3,代码行数:35,
示例9: VAL_INT32*/ void Set_Error_Type(ERROR_OBJ *error)/*** Sets error type and id fields based on code number.*************************************************************************/{ REBSER *cats; // Error catalog object REBSER *cat; // Error category object REBCNT n; // Word symbol number REBCNT code; code = VAL_INT32(&error->code); // Set error category: n = code / 100 + 1; cats = VAL_OBJ_FRAME(Get_System(SYS_CATALOG, CAT_ERRORS)); if (code >= 0 && n < SERIES_TAIL(cats) && NZ(cat = VAL_SERIES(BLK_SKIP(cats, n))) ) { Set_Word(&error->type, FRM_WORD_SYM(cats, n), cats, n); // Find word related to the error itself: n = code % 100 + 3; if (n < SERIES_TAIL(cat)) Set_Word(&error->id, FRM_WORD_SYM(cat, n), cat, n); }}
开发者ID:51weekend,项目名称:r3,代码行数:29,
示例10: Parameters//---------------------------------------------------------bool CGrid_Fill::On_Execute(void){ CSG_Shapes *pPoints = Parameters("POINTS")->asShapes(); if( !pPoints->is_Valid() || !pPoints->Get_Extent().Intersects(Get_System().Get_Extent()) || !Parameters_Set(Parameters) ) { return( false ); } //----------------------------------------------------- int nReplaced = 0; #define GET_NPOINTS (bSelection ? pPoints->Get_Selection_Count() : pPoints->Get_Count()) #define GET_POINT(i) (bSelection ? pPoints->Get_Selection(i)->Get_Point(0) : pPoints->Get_Shape(i)->Get_Point(0)) bool bSelection = pPoints->Get_Selection_Count() > 0; for(int i=0; i<GET_NPOINTS && Process_Get_Okay(); i++) { nReplaced += Fill(GET_POINT(i)); } Message_Fmt("/n%d %s/n", nReplaced, _TL("replacements")); return( true ); }
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:27,
示例11: Get_System*/ REBVAL *Append_Event()/*** Append an event to the end of the current event port queue.** Return a pointer to the event value.**** Note: this function may be called from out of environment,** so do NOT extend the event queue here. If it does not have** space, return 0. (Should it overwrite or wrap???)*************************************************************************/{ REBVAL *port; REBVAL *value; REBVAL *state; port = Get_System(SYS_PORTS, PORTS_SYSTEM); if (!IS_PORT(port)) return 0; // verify it is a port object // Get queue block: state = VAL_BLK_SKIP(port, STD_PORT_STATE); if (!IS_BLOCK(state)) return 0; // Append to tail if room: if (SERIES_FULL(VAL_SERIES(state))) Crash(RP_MAX_EVENTS); VAL_TAIL(state)++; value = VAL_BLK_TAIL(state); SET_END(value); value--; SET_NONE(value); //Dump_Series(VAL_SERIES(state), "state"); //Print("Tail: %d %d", VAL_TAIL(state), nn++); return value;}
开发者ID:RamchandraApte,项目名称:rebol,代码行数:35,
示例12: Parameters//---------------------------------------------------------bool CCost_Accumulated::Get_Destinations(CPoints &Points){ Points.Clear(); m_pAccumulated->Set_NoData_Value(-1.0); m_pAccumulated->Assign(-1.0); m_pAllocation ->Set_NoData_Value(-1.0); m_pAllocation ->Assign( 0.0); if( Parameters("DEST_TYPE")->asInt() == 0 ) // Point { CSG_Shapes *pDestinations = Parameters("DEST_POINTS")->asShapes(); for(int i=0, x, y; i<pDestinations->Get_Count(); i++) { if( Get_System().Get_World_to_Grid(x, y, pDestinations->Get_Shape(i)->Get_Point(0)) && !m_pCost->is_NoData(x, y) ) { Points.Add(x, y); m_pAllocation->Set_Value(x, y, Points.Get_Count()); m_pAccumulated->Set_Value(x, y, 0.0); } } } else // Grid { CSG_Grid *pDestinations = Parameters("DEST_GRID")->asGrid(); for(int y=0; y<Get_NY(); y++) for(int x=0; x<Get_NX(); x++) { if( !pDestinations->is_NoData(x, y) && !m_pCost->is_NoData(x, y) ) { Points.Add(x, y); m_pAllocation->Set_Value(x, y, Points.Get_Count()); m_pAccumulated->Set_Value(x, y, 0.0); } } } return( Points.Get_Count() > 0 );}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:35,
示例13: Get_System*/ void Sieve_Ports(REBSER *ports)/*** Remove all ports not found in the WAKE list.** ports could be NULL, in which case the WAKE list is cleared.*************************************************************************/{ REBVAL *port; REBVAL *waked; REBVAL *val; REBCNT n; port = Get_System(SYS_PORTS, PORTS_SYSTEM); if (!IS_PORT(port)) return; waked = VAL_OBJ_VALUE(port, STD_PORT_DATA); if (!IS_BLOCK(waked)) return; for (n = 0; ports && n < SERIES_TAIL(ports);) { val = BLK_SKIP(ports, n); if (IS_PORT(val)) { assert(VAL_TAIL(waked) != 0); if (VAL_TAIL(waked) == Find_Block_Simple(VAL_SERIES(waked), 0, val)) {//not found Remove_Series(ports, n, 1); continue; } } n++; } //clear waked list RESET_SERIES(VAL_SERIES(waked));}
开发者ID:kealist,项目名称:ren-c,代码行数:31,
示例14: DEM//---------------------------------------------------------bool CHillslope_Evolution_FTCS::On_Execute(void){ //----------------------------------------------------- CSG_Grid DEM(Get_System()); m_pDEM_Old = &DEM; m_pDEM = Parameters("MODEL")->asGrid(); m_pDEM->Assign(Parameters("DEM")->asGrid()); DataObject_Set_Colors(Parameters("DIFF")->asGrid(), 10, SG_COLORS_RED_GREY_BLUE, true); //----------------------------------------------------- double k, dTime, nTime; k = Parameters("KAPPA" )->asDouble(); nTime = Parameters("DURATION")->asDouble(); if( Parameters("TIMESTEP")->asInt() == 0 ) { dTime = Parameters("DTIME")->asDouble(); } else { dTime = 0.5 * Get_Cellarea() / (2.0 * k); if( Parameters("NEIGHBOURS")->asInt() == 1 ) { dTime /= sqrt(2.0); } } if( dTime > nTime ) { Message_Fmt("/n%s: %s [%f]", _TL("Warning"), _TL("Time step exceeds duration"), dTime); dTime = nTime; } Message_Fmt("/n%s: %f", _TL("Time Step"), dTime); Message_Fmt("/n%s: %d", _TL("Steps"), (int)(nTime / dTime)); //----------------------------------------------------- for(double iTime=dTime; iTime<=nTime && Set_Progress(iTime, nTime); iTime+=dTime) { Process_Set_Text("%s: %.2f [%.2f]", _TL("Simulation Time"), iTime, nTime); SG_UI_Progress_Lock(true); Set_Diffusion(dTime * k / Get_Cellarea()); Set_Difference(); SG_UI_Progress_Lock(false); } //----------------------------------------------------- return( true );}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:61,
示例15: switch//---------------------------------------------------------bool CGrid_Profile::On_Execute_Position(CSG_Point ptWorld, TSG_Module_Interactive_Mode Mode){ switch( Mode ) { default: break; case MODULE_INTERACTIVE_LDOWN: if( !m_bAdd ) { m_bAdd = true; m_pLine->Create(SHAPE_TYPE_Line, CSG_String::Format(SG_T("Profile [%s]"), m_pDEM->Get_Name())); m_pLine->Add_Field("ID" , SG_DATATYPE_Int); m_pLine->Add_Shape()->Set_Value(0, 1); } m_pLine->Get_Shape(0)->Add_Point(Get_System()->Fit_to_Grid_System(ptWorld)); DataObject_Update(m_pLine); break; case MODULE_INTERACTIVE_RDOWN: Set_Profile(); m_bAdd = false; break; } return( true );}
开发者ID:am2222,项目名称:SAGA-GIS,代码行数:30,
示例16: SaveGridsAsTIFFbool Cdodproperror::SaveGridsAsTIFF(CSG_Grid** grids, CSG_Strings paths){ TSG_Data_Type Type; CSG_String FilePath; CSG_Grid* Grid; // SAVE TIFFS for (int i = 0; i < paths.Get_Count(); i++) { FilePath = paths[i]; Grid = grids[i]; Type = Grid->Get_Type(); if( !GDALDataSet.Open_Write(FilePath, GDALDriver, GDALOptions, Type, 1, *Get_System(), Projection) ) { Error_Set(CSG_String::Format(SG_T("%s: '%s' "), _TL("Failed to open file for writing: "), FilePath.c_str())); return( false ); } GDALDataSet.Write(0, Grid); if( !GDALDataSet.Close() ) { Error_Set(CSG_String::Format(SG_T("%s: '%s' "), _TL("Failed to close file after writing: "), FilePath.c_str())); return( false ); } } return true;}
开发者ID:sina-masoud-ansari,项目名称:saga-gis,代码行数:28,
示例17: Process_Set_Text//---------------------------------------------------------bool CTopographic_Correction::Get_Illumination(void){ Process_Set_Text(_TL("Illumination calculation")); //----------------------------------------------------- CSG_Grid DEM, *pDEM = Parameters("DEM")->asGrid(); if( !pDEM->Get_System().is_Equal(*Get_System()) ) { DEM.Create(*Get_System()); DEM.Assign(pDEM, pDEM->Get_Cellsize() > Get_Cellsize() ? GRID_INTERPOLATION_BSpline : GRID_INTERPOLATION_Mean_Cells); pDEM = &DEM; } //----------------------------------------------------- double Azi = Parameters("AZI")->asDouble() * M_DEG_TO_RAD; double Hgt = Parameters("HGT")->asDouble() * M_DEG_TO_RAD; m_cosTz = cos(M_PI_090 - Hgt); m_sinTz = sin(M_PI_090 - Hgt); m_Slope .Create(*Get_System()); m_Illumination .Create(*Get_System()); //----------------------------------------------------- for(int y=0; y<Get_NY() && Set_Progress(y); y++) { for(int x=0; x<Get_NX(); x++) { double Slope, Aspect; if( pDEM->Get_Gradient(x, y, Slope, Aspect) ) { m_Slope .Set_Value(x, y, Slope); m_Illumination .Set_Value(x, y, cos(Slope) * m_cosTz + sin(Slope) * m_sinTz * cos(Azi - Aspect)); } else { m_Slope .Set_Value(x, y, 0.0); m_Illumination .Set_Value(x, y, m_cosTz); } } } //----------------------------------------------------- return( true );}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:48,
示例18: DataObject_Add//---------------------------------------------------------bool CKinWav_D8::Gauges_Initialise(void){ if( m_pGauges_Flow != NULL ) { if( m_pGauges == NULL ) { DataObject_Add(m_pGauges = SG_Create_Shapes(SHAPE_TYPE_Point, _TL("Gauges"))); Parameters("GAUGES")->Set_Value(m_pGauges); m_pGauges->Add_Field(_TL("ID"), SG_DATATYPE_Int); for(int y=0; y<Get_NY() && Set_Progress(y); y++) { for(int x=0; x<Get_NX(); x++) { bool bBorder = false; bool bLowest = true; for(int i=0; i<8; i++) { int ix = Get_xTo(i, x); int iy = Get_yTo(i, y); if( !m_pDEM->is_InGrid(ix, iy) ) { bBorder = true; } else if( m_pDEM->asDouble(ix, iy) < m_pDEM->asDouble(x, y) ) { bLowest = false; } } if( bLowest && bBorder ) { CSG_Shape *pGauge = m_pGauges->Add_Shape(); pGauge->Add_Point(Get_System()->Get_Grid_to_World(x, y)); pGauge->Set_Value(0, m_pGauges->Get_Count() + 1); } } } } m_pGauges_Flow->Destroy(); m_pGauges_Flow->Set_Name(_TL("Outlet Hydrographs")); m_pGauges_Flow->Add_Field("TIME", SG_DATATYPE_Double); for(int i=0; i<m_pGauges->Get_Count(); i++) { m_pGauges_Flow->Add_Field(CSG_String::Format(SG_T("GAUGE_%02d"), i + 1), SG_DATATYPE_Double); } return( true ); } return( false );}
开发者ID:johanvdw,项目名称:saga-debian,代码行数:60,
示例19: Get_System*/ REBINT Get_System_Int(REBCNT i1, REBCNT i2, REBINT default_int)/*** Get an integer from system object.*************************************************************************/{ REBVAL *val = Get_System(i1, i2); if (IS_INTEGER(val)) return VAL_INT32(val); return default_int;}
开发者ID:51weekend,项目名称:r3,代码行数:10,
示例20: //---------------------------------------------------------CWKSP_Grid_System * CWKSP_Grid_Manager::_Get_System(const CSG_Grid_System &System){ CWKSP_Grid_System *pItem = NULL; if( (pItem = Get_System(System)) == NULL ) { Add_Item(pItem = new CWKSP_Grid_System(System)); } return( pItem );}
开发者ID:sinozope,项目名称:SAGA-GIS-git-mirror,代码行数:12,
注:本文中的Get_System函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ Get_xTo函数代码示例 C++ Get_SB函数代码示例 |