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


C++ WorkSpace类代码示例

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


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

示例1: ShowMessage

void __fastcall TDesignFrm::btAddSubHeadClick(TObject *Sender)
{
    String  key = vleHeadDef->Keys[vleHeadDef->Row];
    if(key == "")
    {
        ShowMessage("请先选择封包头!");
        return;
    }

    String  fileName;
    if(InputQuery("输入文件名(不加后缀)", "输入文件名(不加后缀)", fileName))
    {
        if(fileName == "")
            return;

        if(fileName.Pos("."))
            fileName = LeftString(fileName, ".");
        fileName += ".eggxp";

        WorkSpace	*  selWorkSpace = m_WorkSpaceManager->CreateNewWorkSpace();
        selWorkSpace->InitWorkSpace(m_WorkSpaceManager->GetFilePath(),
                    fileName, key);
        selWorkSpace->SaveToFile();
        m_WorkSpaceManager->ReloadWorkSpacePack();
        WorkspaceToGUI();
    }
}
开发者ID:eggxp,项目名称:SuperParse,代码行数:27,代码来源:FrmDesign.cpp

示例2: main

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	WorkSpace w;
	w.show();
	return a.exec();
}
开发者ID:Sunwinds,项目名称:SketchBasedShapeRetrieval,代码行数:7,代码来源:main.cpp

示例3: IntToHex

void __fastcall TDesignFrm::btClearHeadDefClick(TObject *Sender)
{
    int result = Application->MessageBox(L"这个清空动作会清空所有文件!  是否继续?",L"删除询问",MB_OKCANCEL);
    if(result == IDCANCEL)
    {
        return;
    }

    m_WorkSpaceManager->BeginUpdate();
    for(int i=m_WorkSpaceManager->GetWorkSpaceCount()-1; i>=0; i--)
    {
        m_WorkSpaceManager->DeleteWorkSpace(i);
    }


    //添加一条新数据
    String  head = IntToHex(0, 2);
    String  subHead = IntToHex(0, 2);
    String  fileName = FormatStr("Pack_%s_%s.eggxp", head, subHead);
    WorkSpace	*  selWorkSpace = m_WorkSpaceManager->CreateNewWorkSpace();
    selWorkSpace->InitWorkSpace(m_WorkSpaceManager->GetFilePath(),
				fileName, head);

	selWorkSpace->GetFileManager()->CreateNew();
	selWorkSpace->SaveToFile();

	m_WorkSpaceManager->ReloadWorkSpacePack();

	WorkspaceToGUI();
	m_WorkSpaceManager->EndUpdate();
}
开发者ID:eggxp,项目名称:SuperParse,代码行数:31,代码来源:FrmDesign.cpp

示例4: Test_TorsionalMinimisation

void Test_TorsionalMinimisation()
{
	FFParamSet ffps;
	ffps.readLib("lib/amber03aa.ff");

	//System sys(ffps);
	//sys.add(NewProteinHelix(ffps,"*A-(AAAAPAAAA)-A*" ));

	PDB_In sys(ffps,"./pd_double/test.pdb");
	sys.load();

	WorkSpace wspace = WorkSpace( sys );
	RotBond replacement; // Must stay in scope for the lifetime of this wspace...
	wspace.setRotatableBondList( &replacement ); // Override the internal dummy rotbond array
	wspace.info();
	wspace.addStdTra("imported464");
	wspace.outtra.append();

	Forcefield ffs = createffts(wspace);

	SegmentDefBase sd(wspace,37,44,SegBreakCentre);

	TorsionalMinimisation min2( ffs, sd );
	min2.Steps = 3000;
	min2.InitialCapFactor = 0.05;
	min2.UpdateScr = 1;
	min2.UpdateTra = 1;
	min2.UpdateMon = -1;
	min2.run();

	return;
}
开发者ID:JonnyWideFoot,项目名称:pd,代码行数:32,代码来源:scratch.jon.cpp

示例5: configure

void Window::configure( Configuration* c ){
	WorkSpace::create();
	//ユーザー設定
	WorkSpace w;
	WorkSpace::Configuration wsCon;
	w.configure( &wsCon );
	c->setWidth( w.width() );
	c->setHeight( w.height() );
	c->setTitle( w.title() );
}
开发者ID:Marypaz,项目名称:Yoserusu,代码行数:10,代码来源:WorkSpace.cpp

示例6: canUndo

boolean UndoDecoratorMove::canUndo()
{
    VPEAnnotator* dec = this->lookupDecorator();
    if (!dec) return FALSE;
    int w,h;
    dec->getXYSize(&w,&h);
    WorkSpace* ews = dec->getWorkSpace();

    return (ews->isEmpty(this->x, this->y, w, h));
}
开发者ID:BackupTheBerlios,项目名称:opendx2,代码行数:10,代码来源:UndoMove.C

示例7: main

int main(int argc, char **argv) {
	
	Manager manager;
	PropList props;
	CACHE_CONFIG_PATH(props) = "icache.xml";
	try {
		WorkSpace *fw = manager.load(argv[1], props);
		
		// Find main CFG
		CFG *cfg = fw->getCFGInfo()->findCFG("main");
		if(cfg == 0) {
			cerr << "ERROR: cannot find main !\n";
			return 1;
		}
		
		// Removing __eabi call if available
		for(CFG::BBIterator bb(cfg); bb; bb++)
			for(Iterator<Edge *> edge(bb->outEdges()); edge; edge++)
				if(edge->kind() == Edge::CALL
				&& edge->target()
				&& edge->calledCFG()->label() == "__eabi") {
					delete(*edge);
					break;
				}
		
		// Processors configuration
		//PROC_VERBOSE(props) = true;
		//EXPLICIT(props) = true;
		
		// Get external constraints
		ipet::FlowFactLoader ffl;
		ffl.process(fw, props);
			
		// Build CAT contraint
		CATConstraintBuilder decomp;
		decomp.process(fw, props);
					
		// Resolve the system
		WCETComputation wcomp;
		wcomp.process(fw, props);
		
		// Display the result
		//ilp::System *sys = SYSTEM(fw);
		/*sys->dump();
		cout << sys->countVars() << " variables and "
			 << sys->countConstraints() << " constraints.\n";*/
		cout << "WCET = " << WCET(fw) << '\n';
	}
	catch(LoadException e) {
		cerr << "ERROR: " << e.message() << '\n';
		exit(1);
	}
	return 0;
}
开发者ID:alexjordan,项目名称:otawa,代码行数:54,代码来源:test-categorisation.cpp

示例8: main

int main(int argc, char **argv)
{
  WorkSpace *work    = NULL;

  get_args(argc, argv);
  
  srand (getpid());

  work = new WorkSpace();
  work->LoadMotionDB (script_file);
  work->ExecLearning ();
  
  delete work;

  return 0;
}
开发者ID:raghavendrajain,项目名称:mimesis,代码行数:16,代码来源:learning.cpp

示例9: main

int main(int argc, char **argv) {

	Manager manager;
	PropList props;
//	LOADER(props) = &Loader::LOADER_Gliss_PowerPC;
	try {
		WorkSpace *fw = manager.load(argv[1], props);
		
		// Find main CFG
		cout << "Looking for the main CFG\n";
		CFG *cfg = fw->getCFGInfo()->findCFG("main");
		if(cfg == 0) {
			cerr << "ERROR: cannot find main !\n";
			return 1;
		}
		else
			cout << "main found at 0x" << cfg->address() << '\n';
		
		// Build dominance
		Dominance dom;
		dom.processCFG(fw, cfg);
		
		// Display dominance information
		for(CFG::BBIterator bb1(cfg); bb1; bb1++) {
			bool first = true;
			cout << bb1->number() << " dominates {";
			for(CFG::BBIterator bb2(cfg); bb2; bb2++)
				if(Dominance::dominates(bb1, bb2)) {
					if(first)
						first = false;
					else
						cout << ", ";
					cout << bb2->number();
				}
			cout << "}\n";
		}
		
		// Display the result
		cout << "SUCCESS\n";
	}
	catch(LoadException e) {
		cerr << "ERROR: " << e.message() << '\n';
		exit(1);
	}
	return 0;
}
开发者ID:alexjordan,项目名称:otawa,代码行数:46,代码来源:test_dom.cpp

示例10: catch

void Window::update(){
	Window w;
	Graphics::Manager m;
	WorkSpace ws;
	bool sleep = false;
	if( w.isMinimized() ){
		sleep = true;
	}
	//終了チェック
	if( isEndRequested() ){
		ws.requestEnd();
	}
	if( !sleep ){
		ws.preUpdate();
	}
	if( sleep ){
		ws.sleep( 50 );
	} else {
		try{
			ws.update();
		}
		catch( ... ){
			WorkSpace::destroy();
			end();
			throw Mashiro::EXCEPTION_EXIT;
		}
		ws.postUpdate();
	}
	if( ws.isEndRequested() ){
		WorkSpace::destroy();
		end();
	}
}
开发者ID:Marypaz,项目名称:Yoserusu,代码行数:33,代码来源:WorkSpace.cpp

示例11: WorkSpace

void AutoRunThread::run()
{
	string lasFilePath, resFolder;
	WorkSpace *workSpace = NULL;

	lasFilePath = this->lasPath.toStdString();
	resFolder = this->resFolder.toStdString();
	workSpace = new WorkSpace();
	workSpace->newProj(lasFilePath.c_str(), this->cellSize, resFolder.c_str());
	resFolder = workSpace->getResFolder();

	// Seed generation
	if(this->useOBASeedGenerator && this->maxObjSize >= 20.0)
	{
		emit stepInformation(0, tr("start identifying complexity of the scene ..."));
		::calcComplexByObj(workSpace, this->maxObjSize, this->seedHeightTh, this->seedSlopeTh);
		emit stepInformation(20, tr("identifying complexity of the scene finished ..."));
	}

	// Filtering
	emit stepInformation(20, tr("start filter points ..."));
	TINFilter *filter = new TINFilter(workSpace, maxObjSize, this->seedCellSize, this->angleIteration, this->hIteration);
	filter->filterGround(this->filteringHeightTh, this->filteringSlopeTh);
	emit stepInformation(70, tr("filtering points finished ..."));
	
	// Dem interpolation
	emit stepInformation(70, tr("start dem interpolation ..."));
	las2Raster(workSpace, this->dtmFactor);
	emit stepInformation(90, tr("dem interpolation finished..."));
	
	// Object points extraction
	emit stepInformation(90, tr("start get non-groud points ..."));
	extractObjectPoints(workSpace, this->dtmFactor, this->objectHT);
	emit stepInformation(100, tr("process finished successfully!"));

	if (workSpace != NULL)
	{
		delete workSpace;
		workSpace = NULL;
	}
}
开发者ID:yanmenglong,项目名称:ALSDo,代码行数:41,代码来源:autorunthread.cpp

示例12: generate_with_symbol_space

int generate_with_symbol_space(void)
{
  
	Behavior    *tmp_beh, *beh;
	WorkSpace   *work = NULL;
	work = new WorkSpace();
	tl_message ("Now loading motionDBs...");
	work->Load          ("../../script/learning_scriptfile_3");
	tl_message ("Now loading recogunits...");
	work->SetRecogUnits ("../../script/learning_scriptfile_3");
	work->SetLabelFromRecogUnit();
	work->BeforeRecognize();
	work->SetDisVector();
	work->SymmentrizeDisVector();
	work->SpaceCreate(3);

	vector<double> tmp_dis;
	vector<double> tmp_cord;
	int span = 20, step = 5;
	Pose *pose;

	cur_beh = new Behavior();
	for (int i=0; i<span; i++)
		{
			data = TOYOTA_GetMotionCaptureData();
			joint_angle = TOYOTA_TransferCaptureToJoint(data);
			pose = new Pose(dof, joint_angle);  // dof = number of DoF, joint_angle : sequence of double
			cur_beh->AddPose(pose);
		}
	for (int j=0; j<1000; j++)
		{
			cerr << "----------------  pop" << endl;
			for (int i=0; i<step; i++)
				{
					cur_beh->PopFrontPose();
					data = TOYOTA_GetMotionCaptureData();
					joint_angle = TOYOTA_TransferCaptureToJoint(data);
					pose = new Pose(dof, joint_angle);  // dof = number of DoF, joint_angle : sequence of double
					cur_beh->AddPose(pose);
				}
			cerr << "----------------  CalcDis" << endl;
			// その一部分の動作を空間に射影した場合の,各既知原始シンボルからの距離を計測
			tmp_dis = work->CalcDistanceOfInputBehavior(cur_beh);
			cerr << "----------------  GetCoordinate" << endl;
			// 求めた距離に応じて,空間に射影するべき座標を算出
			tmp_cord = work->GetPsymbolSpace()->CoordinateFromDistanceData(tmp_dis);
			cerr << "!!!!! " << j << "th Gene Start!" << endl;
			// その座標における動作を生成する.
			work->BehGeneFromTransition(tmp_cord);
			cerr << "!!!!! " << j << "th Gene Finish!" << endl;
			tmp_beh = work->GetLastBehavior ();
			for (int i=0; i<step; i++)
				{
					TOYOTA_ActuateRobot (tmp_beh->NthPose(i));
				}
		}
	return TRUE;
}
开发者ID:t-inamura,项目名称:mimesis,代码行数:58,代码来源:imitation.cpp

示例13: Char

static MRESULT APIENTRY Char ( HWND Window, MESG, MPARAM1 mp1, MPARAM2 mp2 ) {

 /***************************************************************************
  * Find the instance data.                                                 *
  ***************************************************************************/

  PDATA Data = PDATA ( Sys_GetWindowData ( Window ) ) ;

 /***************************************************************************
  * Get the message data.                                                   *
  ***************************************************************************/

  USHORT Flags    = (USHORT) SHORT1FROMMP ( mp1 ) ;
//UCHAR  Repeat   = (UCHAR)   CHAR3FROMMP ( mp1 ) ;
//UCHAR  ScanCode = (UCHAR)   CHAR4FROMMP ( mp1 ) ;

//USHORT Char     = (USHORT) SHORT1FROMMP ( mp2 ) ;
  USHORT VKey     = (USHORT) SHORT2FROMMP ( mp2 ) ;

 /***************************************************************************
  * Ignore keys being released, invalid characters, dead keys and           *
  *   invalid composite characters.                                         *
  ***************************************************************************/

  if ( ( Flags & KC_KEYUP )
    OR ( Flags & KC_INVALIDCHAR )
    OR ( Flags & KC_DEADKEY )
    OR ( Flags & KC_INVALIDCOMP ) )
  {
    Sys_BeepNote ( ) ;
    return ( MRFROMSHORT ( FALSE ) ) ;
  }

 /***************************************************************************
  * Intercept the ESC virtual key to abort margin set mode.                 *
  ***************************************************************************/

  if ( Flags & KC_VIRTUALKEY ) {

    switch ( VKey ) {

      case VK_ESC: {

        if ( Data->Capture ) {

          Data->Capture = FALSE ;
          Sys_ReleaseCapture ( ) ;

          HPOINTER Ptr = WinQuerySysPointer ( HWND_DESKTOP, SPTR_ARROW, FALSE ) ;
          WinSetPointer ( HWND_DESKTOP, Ptr ) ;

          Sys_SetFocus ( Data->HadFocus ) ;

          WorkSpace PS ( "HRuler::Char", 0, Window, Data->pDevice, int(Data->Metric) ) ;
          PS.SetTransform ( Data->fxZoom, int(Data->TopLeft), 0 ) ;

          RECTL Rectangle ;
          WinQueryWindowRect ( Window, &Rectangle ) ;
          PS.Transform ( CVTC_DEVICE, CVTC_DEFAULTPAGE, Rectangle ) ;

          POINTL ButtonSize = { 8, 8 } ;
          PS.Transform ( CVTC_DEVICE, CVTC_PAGE, 1, &ButtonSize ) ;

          PS.SetMix ( FM_INVERT ) ;
          PS.SetLineType ( LINETYPE_ALTERNATE ) ;
          POINTL Point = { Data->Tick, Rectangle.yBottom } ;
          PS.Move ( Point ) ;
          Point.y = Rectangle.yTop ;
          PS.DrawLine ( Point ) ;

          Data->Mode = NOTMOVING ;
        }

        break ;
      }
    }
  }

 /***************************************************************************
  * Return.                                                                 *
  ***************************************************************************/

  return ( MRFROMSHORT ( TRUE ) ) ;
}
开发者ID:OS2World,项目名称:APP-PRODUCTIVITY-Escriba,代码行数:84,代码来源:HRULER.CPP

示例14: Button1Up

static MRESULT APIENTRY Button1Up ( HWND Window, MESG, MPARAM1 mp1, MPARAM2 ) {

 /***************************************************************************
  * Find the instance data.                                                 *
  ***************************************************************************/

  PDATA Data = PDATA ( Sys_GetWindowData ( Window ) ) ;

 /***************************************************************************
  * If the mouse wasn't captured, return.                                   *
  ***************************************************************************/

  if ( NOT Data->Capture )
    return ( MRFROMSHORT ( FALSE ) ) ;

 /***************************************************************************
  * Get the presentation space.                                             *
  ***************************************************************************/

  WorkSpace PS ( "HRuler::Button1Up", 0, Window, Data->pDevice, int(Data->Metric) ) ;
  PS.SetTransform ( Data->fxZoom, int(Data->TopLeft), 0 ) ;

 /***************************************************************************
  * Find out where the mouse touched.                                       *
  ***************************************************************************/

  RECTL Rectangle ;
  WinQueryWindowRect ( Window, &Rectangle ) ;

  POINTL Mouse = { SHORT1FROMMP(mp1), SHORT2FROMMP(mp1) } ;
  PS.Transform ( CVTC_DEVICE, CVTC_DEFAULTPAGE, 1, &Mouse ) ;

  PS.Transform ( CVTC_DEVICE, CVTC_DEFAULTPAGE, Rectangle ) ;

  POINTL ButtonSize = { 8, 8 } ;
  PS.Transform ( CVTC_DEVICE, CVTC_PAGE, 1, &ButtonSize ) ;

  #ifdef DEBUG
     Log ( "HRuler::Button1Up:   Mouse at %i,%i (%i,%i).  Rectangle %i,%i-%i,%i.  ButtonSize %i.%i (8x8).",
        Mouse.x, Mouse.y, SHORT1FROMMP(mp1), SHORT2FROMMP(mp1), 
        Rectangle.xLeft, Rectangle.yBottom, Rectangle.xRight, Rectangle.yTop,
        ButtonSize.x, ButtonSize.y ) ;
  #endif

 /***************************************************************************
  * Erase the previous hairline.                                            *
  ***************************************************************************/

  PS.SetMix ( FM_INVERT ) ;
  PS.SetLineType ( LINETYPE_ALTERNATE ) ;
  POINTL Point = { Data->Tick, Rectangle.yBottom } ;
  PS.Move ( Point ) ;
  Point.y = Rectangle.yTop ;
  PS.DrawLine ( Point ) ;

 /***************************************************************************
  * Release the mouse.                                                      *
  ***************************************************************************/

  Data->Capture = FALSE ;
  Sys_ReleaseCapture ( ) ;

 /***************************************************************************
  * Restore the normal mouse pointer.                                       *
  ***************************************************************************/

  HPOINTER Ptr = WinQuerySysPointer ( HWND_DESKTOP, SPTR_ARROW, FALSE ) ;
  WinSetPointer ( HWND_DESKTOP, Ptr ) ;

 /***************************************************************************
  * Restore the keyboard focus.                                             *
  ***************************************************************************/

  Sys_SetFocus ( Data->HadFocus ) ;

 /***************************************************************************
  * Process final location of mouse.                                        *
  ***************************************************************************/

  switch ( Data->Mode ) {

    case MOVELEFT:
    {
      Data->Tick = TICK(Mouse.x) ;
      if ( ( Data->Tick < 0 ) OR ( Data->Tick >= Data->RightMargin ) )
      {
        Sys_BeepError ( ) ;
        break ;
      }
      Sys_SendMessage ( OWNER(Window), WM_SET_LEFTMARGIN, MPFROMLONG(Data->Tick), 0 ) ;
      break ;
    }

    case MOVERIGHT:
    {
      Data->Tick = TICK(Mouse.x) ;
      if ( ( Data->Tick <= Data->LeftMargin ) OR ( Data->Tick > Data->PageWidth ) )
      {
        Sys_BeepError ( ) ;
        break ;
//.........这里部分代码省略.........
开发者ID:OS2World,项目名称:APP-PRODUCTIVITY-Escriba,代码行数:101,代码来源:HRULER.CPP

示例15: MouseMove

static MRESULT APIENTRY MouseMove ( HWND Window, MESG msg, MPARAM1 mp1, MPARAM2 mp2 ) {

 /***************************************************************************
  * Find the instance data.                                                 *
  ***************************************************************************/

  PDATA Data = PDATA ( Sys_GetWindowData ( Window ) ) ;

 /***************************************************************************
  * If the mouse wasn't captured, return.                                   *
  ***************************************************************************/

  if ( NOT Data->Capture )
    return ( Sys_DefWindowProc ( Window, msg, mp1, mp2 ) ) ;

 /***************************************************************************
  * Get the presentation space.                                             *
  ***************************************************************************/

  WorkSpace PS ( "HRuler::MouseMove", 0, Window, Data->pDevice, int(Data->Metric) ) ;
  PS.SetTransform ( Data->fxZoom, int(Data->TopLeft), 0 ) ;

 /***************************************************************************
  * Find out where the mouse touched.                                       *
  ***************************************************************************/

  RECTL Rectangle ;
  WinQueryWindowRect ( Window, &Rectangle ) ;

  POINTL Mouse = { SHORT1FROMMP(mp1), SHORT2FROMMP(mp1) } ;
  PS.Transform ( CVTC_DEVICE, CVTC_DEFAULTPAGE, 1, &Mouse ) ;

  PS.Transform ( CVTC_DEVICE, CVTC_DEFAULTPAGE, Rectangle ) ;

  POINTL ButtonSize = { 8, 8 } ;
  PS.Transform ( CVTC_DEVICE, CVTC_PAGE, 1, &ButtonSize ) ;

  #ifdef DEBUG
     Log ( "HRuler::MouseMove:   Mouse at %i,%i (%i,%i).  Rectangle %i,%i-%i,%i.  ButtonSize %i.%i (8x8).",
        Mouse.x, Mouse.y, SHORT1FROMMP(mp1), SHORT2FROMMP(mp1), 
        Rectangle.xLeft, Rectangle.yBottom, Rectangle.xRight, Rectangle.yTop,
        ButtonSize.x, ButtonSize.y ) ;
  #endif

 /***************************************************************************
  * Erase the previous hairline.                                            *
  ***************************************************************************/

  PS.SetMix ( FM_INVERT ) ;
  PS.SetLineType ( LINETYPE_ALTERNATE ) ;

  POINTL Point = { Data->Tick, Rectangle.yBottom } ;
  PS.Move ( Point ) ;
  Point.y = Rectangle.yTop ;
  PS.DrawLine ( Point ) ;

 /***************************************************************************
  * Save the current hairline position.                                     *
  ***************************************************************************/

  Data->Tick = TICK(Mouse.x) ;

 /***************************************************************************
  * Draw a hairline showing the current position.                           *
  ***************************************************************************/

  Point.x = Data->Tick ;
  Point.y = Rectangle.yBottom ;
  PS.Move ( Point ) ;
  Point.y = Rectangle.yTop ;
  PS.DrawLine ( Point ) ;

 /***************************************************************************
  * We're done.                                                             *
  ***************************************************************************/

  return ( MRFROMSHORT ( TRUE ) ) ;
}
开发者ID:OS2World,项目名称:APP-PRODUCTIVITY-Escriba,代码行数:78,代码来源:HRULER.CPP


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