コード例 #1
0
void TestTextFrameManagement::testFrameRemoval()
{
    KWTextFrameSet tfs(0);

    createFrame(QPointF(10, 10), tfs);
    createFrame(QPointF(10, 120), tfs);
    createFrame(QPointF(10, 1000), tfs);

    QCOMPARE(tfs.frameCount(), 3);
    tfs.framesEmpty(0);
    QCOMPARE(tfs.frameCount(), 3);
    tfs.framesEmpty(1);
    QCOMPARE(tfs.frameCount(), 3); // don't autodelete when we don't have a pagemanager

    KWPageManager pm;
    pm.appendPage();
    pm.appendPage();
    tfs.setPageManager(&pm);

    QCOMPARE(tfs.frameCount(), 3);
    tfs.framesEmpty(0);
    QCOMPARE(tfs.frameCount(), 3);
    tfs.framesEmpty(1);
    QCOMPARE(tfs.frameCount(), 2);
    tfs.framesEmpty(1);
    QCOMPARE(tfs.frameCount(), 2); // both on one page
    tfs.framesEmpty(2);
    QCOMPARE(tfs.frameCount(), 2); // leave one
}
コード例 #2
0
ファイル: TestTextFrameSorting.cpp プロジェクト: KDE/koffice
void TestTextFrameSorting::testSimpleSorting()
{
    KWTextFrameSet tfs(0);
    KWFrame *frame1 = createFrame(QPointF(10, 10), tfs);
    KWFrame *frame2 = createFrame(QPointF(120, 10), tfs);
    frame2->shape()->setSize(QSizeF(100, 100));
    KWFrame *frame3 = createFrame(QPointF(10, 110), tfs);

    qSort(tfs.m_frames.begin(), tfs.m_frames.end(), KWTextFrameSet::sortTextFrames);

    QCOMPARE(tfs.m_frames[0], frame1);
    QCOMPARE(tfs.m_frames[1], frame3);
    QCOMPARE(tfs.m_frames[2], frame2);

    KWPageManager pm;
    tfs.setPageManager(&pm);
    pm.appendPage();
    pm.appendPage();
    KWFrame *frame4 = createFrame(QPointF(10, 1000), tfs); // page 2
    KWFrame *frame5 = createFrame(QPointF(120, 1000), tfs);

    qSort(tfs.m_frames.begin(), tfs.m_frames.end(), KWTextFrameSet::sortTextFrames);

    QCOMPARE(tfs.m_frames[0], frame1);
    QCOMPARE(tfs.m_frames[1], frame3);
    QCOMPARE(tfs.m_frames[2], frame2);
    QCOMPARE(tfs.m_frames[3], frame4);
    QCOMPARE(tfs.m_frames[4], frame5);
}
コード例 #3
0
ファイル: kgarchives.cpp プロジェクト: jorgeolivares/krusader
KgArchives::KgArchives(bool first, QWidget* parent) :
        KonfiguratorPage(first, parent)
{
    QWidget *innerWidget = new QFrame(this);
    setWidget(innerWidget);
    setWidgetResizable(true);
    QGridLayout *kgArchivesLayout = new QGridLayout(innerWidget);
    kgArchivesLayout->setSpacing(6);

    //  ------------------------ KRARC GROUPBOX --------------------------------

    QGroupBox *krarcGrp = createFrame(i18n("krarc ioslave"), innerWidget);
    QGridLayout *krarcGrid = createGridLayout(krarcGrp);

    KONFIGURATOR_CHECKBOX_PARAM krarcOptions[] =
        //   cfg_class  cfg_name                  default           text                                          restart ToolTip
    {
        {"kio_krarc", "EnableWrite", false, i18n("Enable Write Support"), false, i18n("Enable writing to archives using the krarc ioslave.")}
    };

    KonfiguratorCheckBoxGroup *krarcCheckBoxes = createCheckBoxGroup(1, 0, krarcOptions, 1, krarcGrp);

    krarcGrid->addWidget(krarcCheckBoxes, 1, 0);
    krarcGrid->addWidget(
            new QLabel(i18n("<b>Caution when moving into archives:</b><br/>"
                            "<b>Failure during the process might result in data loss.</b><br/>"
                            "<b>Moving archives into themselves will delete them.</b>"), krarcGrp),
            2, 0);

    kgArchivesLayout->addWidget(krarcGrp, 1 , 0);

    //  ------------------------ FINE-TUNING GROUPBOX --------------------------------

    QGroupBox *fineTuneGrp = createFrame(i18n("Fine-Tuning"), innerWidget);
    QGridLayout *fineTuneGrid = createGridLayout(fineTuneGrp);

    KONFIGURATOR_CHECKBOX_PARAM finetuners[] =
        //   cfg_class  cfg_name                  default           text                                          restart ToolTip
    {
        {"Archives", "Test Archives",           _TestArchives,    i18n("Test archive after packing"), false,  i18n("Check the archive's integrity after packing it.")},
        {"Archives", "Test Before Unpack",      _TestBeforeUnpack, i18n("Test archive before unpacking"), false,  i18n("Some corrupted archives might cause a crash; therefore, testing is suggested.")}
    };

    KonfiguratorCheckBoxGroup *finetunes = createCheckBoxGroup(1, 0, finetuners, 2, fineTuneGrp);

    disableNonExistingPackers();
    fineTuneGrid->addWidget(finetunes, 1, 0);

    kgArchivesLayout->addWidget(fineTuneGrp, 2 , 0);

    if (first)
        slotAutoConfigure();

}
コード例 #4
0
ファイル: TestTextFrameSorting.cpp プロジェクト: KDE/koffice
void TestTextFrameSorting::testSimpleSorting2() // cascading usecase
{
    KWTextFrameSet tfs(0);
    KWFrame *frame4 = createFrame(QPointF(120, 300), tfs); // note that each frame is 50 x 50 per default.
    KWFrame *frame2 = createFrame(QPointF(120, 120), tfs);
    KWFrame *frame3 = createFrame(QPointF(10, 240), tfs);
    KWFrame *frame1 = createFrame(QPointF(10, 10), tfs);

    qSort(tfs.m_frames.begin(), tfs.m_frames.end(), KWTextFrameSet::sortTextFrames);

    QCOMPARE(tfs.m_frames[0], frame1);
    QCOMPARE(tfs.m_frames[1], frame2);
    QCOMPARE(tfs.m_frames[2], frame3);
    QCOMPARE(tfs.m_frames[3], frame4);

    KWPageManager pm;
    tfs.setPageManager(&pm);
    pm.appendPage();
    pm.appendPage();
    KWFrame *frame21 = createFrame(QPointF(120, 1000), tfs);
    KWFrame *frame20 = createFrame(QPointF(10, 1000), tfs);
    KWFrame *frame23 = createFrame(QPointF(120, 1200), tfs);
    KWFrame *frame22 = createFrame(QPointF(10, 1110), tfs);

    qSort(tfs.m_frames.begin(), tfs.m_frames.end(), KWTextFrameSet::sortTextFrames);

    QCOMPARE(tfs.m_frames[0], frame1);
    QCOMPARE(tfs.m_frames[1], frame2);
    QCOMPARE(tfs.m_frames[2], frame3);
    QCOMPARE(tfs.m_frames[3], frame4);
    QCOMPARE(tfs.m_frames[4], frame20);
    QCOMPARE(tfs.m_frames[5], frame21);
    QCOMPARE(tfs.m_frames[6], frame22);
    QCOMPARE(tfs.m_frames[7], frame23);
}
コード例 #5
0
ファイル: adminconnection.cpp プロジェクト: glew/tpserver-cpp
void AdminConnection::processGetCommandTypes(InputFrame::Ptr frame){
  DEBUG("doing get command types frame");

  OutputFrame::Ptr of = createFrame(frame);
  CommandManager::getCommandManager()->doGetCommandTypes(frame, of);
  sendFrame(of);
}
コード例 #6
0
ファイル: adminconnection.cpp プロジェクト: glew/tpserver-cpp
void AdminConnection::processDescribeCommand(InputFrame::Ptr frame)
{
  Logger::getLogger()->debug("doing describe command frame");

  if(frame->getDataLength() < 4){
    throw FrameException(fec_FrameError);
  }

  int numdesc = frame->unpackInt();

  if(frame->getDataLength() < 4 + 4 * numdesc){
    throw FrameException(fec_FrameError);
  }

  sendSequence(frame,numdesc);

  if(numdesc == 0){
    DEBUG("asked for no commands to describe");
    throw FrameException( fec_NonExistant, "You didn't ask for any command descriptions, try again");
  }

  for(int i = 0; i < numdesc; i++){
    OutputFrame::Ptr of = createFrame(frame);
    int cmdtype = frame->unpackInt();
    CommandManager::getCommandManager()->describeCommand(cmdtype, of);
    sendFrame(of);
  }
}
コード例 #7
0
MenuSample::MenuSample()
  : OFrame(MENU_MAIN, FCF_STANDARD & ~FCF_MENU)
{
 createFrame("OMenu - Sample Application");
 menu = new OMenu(MENU_MENU, frame, client, NULLHANDLE);
 showFrame();
}
コード例 #8
0
ファイル: tetris.c プロジェクト: mabruraas/tetris
int main(int argc, char ** argv)
{
	createFrame();
	createNewBlockBatch();
	renderCanvas();

	while (inGame)
	{
		checkGameState();
		checkRowCompletion();
		spawnNewBlock();

		fetchUserInput();

		if(timer++ % 10 == 0 
			&& gameState == 0) {
			moveDown();
		}
		
		renderCanvas();
		usleep(wait);
	}

	endwin();

	return 0;
}
コード例 #9
0
 //Convenient function to draw a frame directly without using createFrame, getMeshFrame, and drawMeshFrame separately. 
 void drawFrame(unsigned int animationId, double time) {
     createFrame(animationId, time);
     for(auto& mesh: this->meshes) {
         MeshFrame meshFrame=getMeshFrame(mesh);
         drawMeshFrame(meshFrame);
     }
 }
コード例 #10
0
void TestFrameLayout::testCopyShapes()
{
    Helper helper;
    m_frames.clear();
    KWPage page = helper.pageManager->page(1);
    KWFrameLayout bfl(helper.pageManager, m_frames);
    connect(&bfl, SIGNAL(newFrameSet(KWFrameSet*)), this, SLOT(addFS(KWFrameSet*)));

    KWTextFrameSet *fs = bfl.getOrCreate(Words::OddPagesHeaderTextFrameSet, page);
    m_frames.append(fs);
    bfl.m_setup = false;

    helper.pageStyle.setHeaderPolicy(Words::HFTypeEvenOdd);

    KWTextFrame *tf = createFrame(QPointF(0,0), *fs);
    KWFrame *cf = createCopyFrame(QPointF(0,300), tf->shape(), *fs);
    QVERIFY(fs->frameCount()==2);
    //FIXME QVERIFY(bfl.hasFrameOn(fs, 1));
    delete tf->shape();

    QVERIFY(fs->frameCount()==1);
    //FIXME QVERIFY(!bfl.hasFrameOn(fs, 1));

    //now try and add a copyframe without crashing
    //sebsauer; it's not crashing but asserting at KWFrameLayout.cpp:750 now
    //bfl.createNewFramesForPage(1);
}
コード例 #11
0
void AttitudeIndicator::itemSizeChanged(float w, float h) {
    // The guage has changed size: redraw the cached pixmaps.
    createCard(w,h);
    createFrame(w,h);
    createGlass(w,h);
    createBackground(w,h);
}
コード例 #12
0
ファイル: adminconnection.cpp プロジェクト: glew/tpserver-cpp
void AdminConnection::processCommand(InputFrame::Ptr frame){
  DEBUG("doing command frame");

  OutputFrame::Ptr of = createFrame(frame);
  CommandManager::getCommandManager()->executeCommand(frame, of);
  sendFrame(of);
}
コード例 #13
0
ファイル: turnbank.cpp プロジェクト: dankrusi/ExtPlane-Panel
TurnAndBank::TurnAndBank(ExtPlanePanel *panel, ExtPlaneConnection *conn) :
    PanelItem(panel, PanelItemTypeGauge, PanelItemShapeCircular),
    _client(this, typeName(), conn)
{
    _rollValue = 10;
    _slipValue = -20;
    
    //    _rollRef = QString("sim/cockpit2/gauges/indicators/turn_rate_roll_deg_pilot");
    _rollRef = QString("sim/cockpit2/gauges/indicators/roll_electric_deg_pilot");   // Matches XP's C172
    //_rollRef = QString("sim/cockpit2/gauges/indicators/turn_rate_heading_deg_pilot");
    _slipRef = QString("sim/cockpit2/gauges/indicators/slip_deg");
    
    //    _card = QPixmap(QString("junk"));//../images/engine_FUELP.png"));

    createCard();
    //createGlass();
    createFrame();
    createBall();
    //_bezel = QPixmap::fromImage(QImage(QString("../images/bezel_square_.png")), Qt::AutoColor);
    
    connect(&_client, SIGNAL(refChanged(QString,double)), this, SLOT(refChanged(QString,double)));
    _client.subscribeDataRef(_slipRef,0.02);
    _client.subscribeDataRef(_rollRef,0.1);
    
}
コード例 #14
0
ファイル: issue.c プロジェクト: freudshow/learnc
U8 proto_assembleFrame(U8* buf, U16* bufSize, U8* gatewayId, \
	U8 MsgIndex, U8 MsgType, U16 bodyLen, U8* pMsgBody)
{
	gateway_protocol_str protoStr = { 0 };

	memset(protoStr.head_str.prefix, GATEWAY_PREFIX, GATEWAY_PREFIX_CNT);//前导符
	memset(&(protoStr.head_str.start), GATEWAY_START, GATEWAY_START_CNT);//开始符
	memset(&(protoStr.head_str.protoVer), GATEWAY_PROTOCOL_VER, 1);//协议版本号

	protoStr.head_str.SourceAddr[0] = 0x01;
	protoStr.head_str.SourceAddr[1] = 0x00;
	protoStr.head_str.SourceAddr[2] = 0x00;
	protoStr.head_str.SourceAddr[3] = 0x00;
	protoStr.head_str.SourceAddr[4] = 0x00;
	protoStr.head_str.SourceAddr[5] = 0x00;
	memcpy(protoStr.head_str.DestAddr, gatewayId, GATEWAY_OADD_LEN);
	protoStr.head_str.MsgID = MsgIndex;
	protoStr.head_str.bodyLen = bodyLen;
	protoStr.head_str.MsgType = MsgType;
	readSysTime(&(protoStr.head_str.sysTime));
	protoStr.head_str.HeadCheck = countCheck(&(protoStr.head_str.protoVer), \
		(sizeof(protocol_head_str) - GATEWAY_PREFIX_CNT - GATEWAY_START_CNT));
	protoStr.pMsgBody = pMsgBody;
	protoStr.bodyChk = countCheck(protoStr.pMsgBody, bodyLen);
	createFrame(buf, bufSize, &protoStr);
	return NO_ERR;
}
コード例 #15
0
ファイル: MeshLoader.cpp プロジェクト: tolstenko/mobagen
/*void SkeletalAnimationModelLoader::loadscene()//(unsigned int animationId, double time)
{
	createFrame(0, 0);
	//if (m_entity) m_entity->delComponents<MeshRenderer>();
	//else m_entity = std::make_shared<Entity>();
	m_entity = std::make_shared<Entity>();

	for (int k = 0; k < meshes.size(); k++)
	{
		MeshFrame meshFrame = getMeshFrame(meshes[k]);

		std::vector<Vertex> vertices;
		std::vector<unsigned int> indices;

		const aiVector3D aiZeroVector(0.0f, 0.0f, 0.0f);
		for (unsigned int i = 0; i < meshFrame.vertices.size(); i++)
		{
			const aiVector3D* pPos = &(meshFrame.vertices[i]);
			const aiVector3D* pNormal = &(meshes[k].normals[i]);
			const aiVector2D* pTexCoord = &(meshes[k].textureCoords[i]);
			const aiVector3D* pTangent = &(meshFrame.tangents[i]);

			Vertex vert(glm::vec3(pPos->x, pPos->y, pPos->z),
				glm::vec2(pTexCoord->x, pTexCoord->y),
				glm::vec3(pNormal->x, pNormal->y, pNormal->z),
				glm::vec3(pTangent->x, pTangent->y, pTangent->z));

			vertices.push_back(vert);
		}
		for (unsigned int i = 0; i < meshes[k].faces.size(); i++)
		{
			indices.push_back(meshes[k].faces[i].mIndices[0]);
			indices.push_back(meshes[k].faces[i].mIndices[1]);
			indices.push_back(meshes[k].faces[i].mIndices[2]);
		}

		MeshRendererData meshRenderData;
		meshRenderData.mesh = std::make_shared<Mesh>(m_fileName + meshes[k].name, &vertices[0], vertices.size(), &indices[0], indices.size());
		meshRenderData.material = Materials[k];

		MeshLoader::sceneMeshRendererDataCache[m_fileName].push_back(meshRenderData);
		m_entity->addComponent<MeshRenderer>(meshRenderData.mesh, meshRenderData.material);
	}
}//*/
  void SkeletalAnimationModelLoader::loadNewFrame(unsigned int animationId, double time) {
    createFrame(animationId, time);

    for (int k = 0; k < meshes.size(); k++) {
      MeshFrame meshFrame = getMeshFrame(meshes[k]);

      std::vector<Vertex> vertices;
      std::vector<unsigned int> indices;

      const aiVector3D aiZeroVector(0.0f, 0.0f, 0.0f);
      for (unsigned int i = 0; i < meshFrame.vertices.size(); i++) {
        const aiVector3D *pPos = &(meshFrame.vertices[i]);
        const aiVector3D *pNormal = &(meshes[k].normals[i]);
        const aiVector2D *pTexCoord = &(meshes[k].textureCoords[i]);
        const aiVector3D *pTangent = &(meshFrame.tangents[i]);

        Vertex vert(glm::vec3(pPos->x, pPos->y, pPos->z),
                    glm::vec2(pTexCoord->x, pTexCoord->y),
                    glm::vec3(pNormal->x, pNormal->y, pNormal->z),
                    glm::vec3(pTangent->x, pTangent->y, pTangent->z));

        vertices.push_back(vert);
      }
      for (unsigned int i = 0; i < meshes[k].faces.size(); i++) {
        indices.push_back(meshes[k].faces[i].mIndices[0]);
        indices.push_back(meshes[k].faces[i].mIndices[1]);
        indices.push_back(meshes[k].faces[i].mIndices[2]);
      }

      MeshLoader::sceneMeshRendererDataCache[m_fileName][k].mesh->reasign(m_fileName + meshes[k].name, &vertices[0],
                                                                          vertices.size(), &indices[0], indices.size());
    }
  }
コード例 #16
0
ファイル: Editor.cpp プロジェクト: dreieier/Nexus
bool Editor::open( void* systemWindow )
{
    createFrame( systemWindow );
    initGui( systemWindow );

    return true;
}
コード例 #17
0
ファイル: interpreter_me.c プロジェクト: Diatirios/CL_SI
// We have not tested this function yet for part a.
Value* apply(Value* function, Value* actualArgs){
  //printf("printing actual arguments: ");
  //printValue(actualArgs);
  //printf("\n");
 
  if (!function){
    return actualArgs;
  }else if (function->type == primitiveType){
    return function->primitiveValue(actualArgs);
  }else if (function->type == closureType){
    List *formalArgs = function->closureValue->args;
    //eval(formalArgs->head, function->closureValue->parent);
    Environment *frame = createFrame(function->closureValue->parent);
    /* Bind formalArgs to actualArgs in frame here. */
    Value *curArg = formalArgs->head;
    Value *curValue = actualArgs;
    while (curArg && curValue){
      assert(getFirst(curArg)->type ==symbolType);
      insertItem(frame->bindings->tableValue, getFirst(curArg)->symbolValue, getFirst(curValue));
      curArg = getTail(curArg);
      curValue = getTail(curValue);
    }
    if (curArg || curValue){
      printf("Wrong number of parameters for the procedure.\n");
      // destroyFrame(frame);
      return NULL;
    }
    
    return eval(function->closureValue->body, frame);
  }else{
    printf("Unknown identifier!");
    return NULL;
  }
}
コード例 #18
0
ファイル: TestTextFrameSorting.cpp プロジェクト: KDE/koffice
void TestTextFrameSorting::testCopyAfterTextSorting()
{
    KWTextFrameSet tfs(0);
    KWTextFrame * frame1 = createFrame(QPointF(70, 1300), tfs);
    KWFrame * frame2 = createCopyFrame(QPointF(70, 100), frame1->shape(), tfs);
    KWTextFrame * frame3 = createFrame(QPointF(70, 2000), tfs);

    tfs.removeFrame(frame1);

    QCOMPARE(tfs.m_frames[0], frame2);
    QCOMPARE(tfs.m_frames[1], frame3);

    qSort(tfs.m_frames.begin(), tfs.m_frames.end(), KWTextFrameSet::sortTextFrames);

    QCOMPARE(tfs.m_frames[0], frame3);
    QCOMPARE(tfs.m_frames[1], frame2);
}
コード例 #19
0
ファイル: TestTextFrameSorting.cpp プロジェクト: KDE/koffice
void TestTextFrameSorting::testSortingById()
{
    KWTextFrameSet tfs(0);
    KWTextFrame * frame1 = createFrame(QPointF(10, 200), tfs);
    KWTextFrame * frame2 = createFrame(QPointF(120, 10), tfs);
    KWTextFrame * frame3 = createFrame(QPointF(10, 10), tfs);

    frame1->setSortingId(1);
    frame2->setSortingId(2);
    frame3->setSortingId(3);

    qSort(tfs.m_frames.begin(), tfs.m_frames.end(), KWTextFrameSet::sortTextFrames);

    QCOMPARE(tfs.m_frames[0], frame1);
    QCOMPARE(tfs.m_frames[1], frame2);
    QCOMPARE(tfs.m_frames[2], frame3);
}
コード例 #20
0
ファイル: form.cpp プロジェクト: Commnets/QGAMES
// ---
QGAMES::Frame* QGAMES::Form::frame (int nf)
{
	QGAMES::Frame* result = NULL;
	if (_frames [nf] == NULL)
		result = _frames [nf] = createFrame (nf);
	else
		result = _frames [nf];
	return (result);
}
コード例 #21
0
void KeyframeModel::addFrame()
{
	if (m_motion.motionName.empty())
		return;

	beginInsertRows(QModelIndex(), 0, m_motion.frames.size());
	m_motion.frames.push_back(createFrame(m_currentFrame));
	endInsertRows();
}
コード例 #22
0
ファイル: TestTextFrameSorting.cpp プロジェクト: KDE/koffice
void TestTextFrameSorting::testSortingOnPagespread()
{
    KWTextFrameSet tfs(0);
    KWFrame * frame1 = createFrame(QPointF(10, 200), tfs);
    KWFrame * frame2 = createFrame(QPointF(120, 10), tfs);
    KWFrame * frame3 = createFrame(QPointF(10, 10), tfs);
    KWFrame * frame4 = createFrame(QPointF(340, 10), tfs);
    KWFrame * frame5 = createFrame(QPointF(230, 10), tfs);

    KWPageManager pm;
    KWPage page = pm.appendPage();
    page.setPageNumber(2);
    KOdfPageLayoutData layout = page.pageStyle().pageLayout();
    layout.width = 450;
    layout.height = 150;
    page.setDirectionHint(KOdfText::LeftRightTopBottom);
    page.setPageSide(KWPage::PageSpread);
    page.pageStyle().setPageLayout(layout);
    page = pm.appendPage();
    page.setDirectionHint(KOdfText::LeftRightTopBottom);
    layout.width = 200;
    page.pageStyle().setPageLayout(layout);
    tfs.setPageManager(&pm);

    QCOMPARE(page.offsetInDocument(), 150.);

    // test KWPageManager::pageNumber first
    QCOMPARE(pm.begin().pageNumber(), 2);
    QCOMPARE(pm.pageNumber(frame2->shape()), 2);
    QCOMPARE(pm.pageNumber(frame1->shape()), 4);

    QCOMPARE(KWTextFrameSet::sortTextFrames(frame4, frame5), false);
    QCOMPARE(KWTextFrameSet::sortTextFrames(frame5, frame4), true);
    QCOMPARE(KWTextFrameSet::sortTextFrames(frame2, frame4), true);
    QCOMPARE(KWTextFrameSet::sortTextFrames(frame1, frame4), false);

    qSort(tfs.m_frames.begin(), tfs.m_frames.end(), KWTextFrameSet::sortTextFrames);

    QCOMPARE(tfs.m_frames[0], frame3);
    QCOMPARE(tfs.m_frames[1], frame2);
    QCOMPARE(tfs.m_frames[2], frame5);
    QCOMPARE(tfs.m_frames[3], frame4);
    QCOMPARE(tfs.m_frames[4], frame1);
}
コード例 #23
0
ファイル: tf_display.cpp プロジェクト: janfrs/kwc-ros-pkg
void TFDisplay::updateFrames()
{
  typedef std::vector<std::string> V_string;
  V_string frames;
  tf_->getFrameStrings( frames );

  S_FrameInfo current_frames;

  {
    V_string::iterator it = frames.begin();
    V_string::iterator end = frames.end();
    for ( ; it != end; ++it )
    {
      const std::string& frame = *it;

      if ( frame.empty() )
      {
        continue;
      }

      FrameInfo* info = getFrameInfo( frame );
      if (!info)
      {
        info = createFrame(frame);
      }
      else
      {
        updateFrame(info);
      }

      current_frames.insert( info );
    }
  }

  {
    S_FrameInfo to_delete;
    M_FrameInfo::iterator frame_it = frames_.begin();
    M_FrameInfo::iterator frame_end = frames_.end();
    for ( ; frame_it != frame_end; ++frame_it )
    {
      if ( current_frames.find( frame_it->second ) == current_frames.end() )
      {
        to_delete.insert( frame_it->second );
      }
    }

    S_FrameInfo::iterator delete_it = to_delete.begin();
    S_FrameInfo::iterator delete_end = to_delete.end();
    for ( ; delete_it != delete_end; ++delete_it )
    {
      deleteFrame( *delete_it );
    }
  }

  causeRender();
}
コード例 #24
0
void Procstat::init()
{
 createFrame("OS/2 Processes");
 
 cnr = new PContainer(this);
 cnr->createContainer();
 cnr->setFont("8.Helv");

 showFrame();
}
コード例 #25
0
ファイル: codegen-lowlev.c プロジェクト: Jped94/yoco
/* Output code for put() / get() */
void outputPutGet(char *intStr)
{
    placeFunLabel("put");     /* put(n) */
    createFrame(FALSE, NULL); /* call printf("%d", n) */
    outputCmd("pushl\t8(%ebp)", 0);  /* push n */
    outputCmd("pushl", 0); fprintf(OUTPUT, intStr); /* push "%d" */
    outputCmd("call\tprintf", 0);
    removeFrame(FALSE, NULL);

    placeFunLabel("get");     /* n = get() */
    createFrame(FALSE, NULL); /* call scanf("%d", &x) */
    outputCmd("subl\t$4, %esp", 0);       /* make room for temporary x at -4(%ebp) */
    outputCmd("leal\t-4(%ebp), %eax", 0);
    outputCmd("pushl\t%eax", 0);          /* push its address */
    outputCmd("pushl", 0); fprintf(OUTPUT, intStr); /* push "%d" */
    outputCmd("call\tscanf", 0);
    outputCmd("movl\t-4(%ebp), %eax", 0); /* return x */
    removeFrame(FALSE, NULL);
}
コード例 #26
0
ファイル: CModelX.cpp プロジェクト: KemogeJam/Kemoge
void CModelX::createFrame(CXFrame *xf, CFrameBone *f, int *num) {
	(*num)++;
	printf("%s %s No%d\n", f->getToken(), f->getName(), f->getNo());
	if (xf->getChild()) {
		CFrameBone *c = new CFrameBone();
		*c = *xf->getChild();
		if (!f->getChild()) f->setChild(c);
		c->setParent(f);
		createFrame(xf->getChild(), c, num);
	}
	if (xf->getNext()) {
		CFrameBone *c = new CFrameBone();
		*c = *xf->getNext();
		f->setNext(c);
		c->setPrev(f);
		c->setParent(f->getParent());
		createFrame(xf->getNext(), c, num);
	}
}
コード例 #27
0
ファイル: history4_funcs.cpp プロジェクト: alinelena/aten
// Import data from the specified file
bool DLP4TrajectoryPlugin::importData()
{
	// Read header information from trajectory file, if there is any
	QString name;
	if ( !fileParser_.readLine ( name ) ) {
		return false;
	}
	targetModel()->setName ( name );
	if ( !fileParser_.skipLines ( 1 ) ) {
		return false;
	}

	// Read the first trajectory frame.
	// The model where we should put the frame data will have been set in the FileParser (in parentModel()).
	// Calling FilePluginInterface::importPart(0) will set the file positions we need, and read in the first frame.
	Model* frame = createFrame();
	if (!importPart(0))
	{
		discardFrame(frame);
		return false;
	}

	if (standardOptions_.isSetAndOn(FilePluginStandardImportOptions::CacheAllSwitch))
	{
		Messenger::print("Caching all frames from HISTORY file (%i %s)...", nDataParts(), isNPartialDataEstimated() ? "estimated" : "actual");
		int count = 0;
		bool frameResult;
		do
		{
			// Add a new trajectory frame
			Model* frame = createFrame();

			// Attempt to read in the next data part in the file
			frameResult = importPart(++count);
			if (!frameResult) discardFrame(frame);
			
		} while (frameResult && (!fileParser_.eofOrBlank()));

		closeFiles();
	}

	return true;
}
コード例 #28
0
ファイル: mdi.c プロジェクト: Airr/iup_mac
void MdiTest(void)
{
  Ihandle* dlg;

  createMenu();

  dlg = createFrame();
//  IupSetAttribute(dlg, "PLACEMENT", "MAXIMIZED");
  IupShow(dlg);
}
コード例 #29
0
ファイル: CModelX.cpp プロジェクト: KemogeJam/Kemoge
bool CModelX::Load(CXModelLoader &loader) {
	boneNum = 0;
	//	printf("f\n");
	//	CXFrame::printFrame(pFrameRoot,0);

	if (0 < loader.animationset.size()) {

		pFrameRoot = new CFrameBone();
		*pFrameRoot = *loader.pRoot;
		createFrame(loader.pRoot, pFrameRoot, &boneNum);
		boneMatrix = new CMatrix[boneNum];

		animation = new CAnimation(loader.animationset);
		animation->attachFrame(pFrameRoot);
		//		CXFrame::printMatrix(pFrameRoot);



				//アニメーション用
		m_shader = new CShader("shader\\skinmesh.vert", "shader\\mesh.flag");
	}
	else {
		animation = NULL;
		//アニメーション無し用
		m_shader = new CShader("shader\\mesh.vert", "shader\\mesh.flag");
	}
	pMaterialList = new std::vector<CMaterial*>;
	for (unsigned int i = 0; i < loader.materials.size(); i++)
		pMaterialList->push_back(new CMaterial(*loader.materials[i]));

	pMeshList = new std::vector < CMesh* >;
	for (unsigned int i = 0; i < loader.mesh.size(); i++) {
		CXMesh *m = loader.mesh[i];
		CSkinWeights *weight = NULL;
		if (m->nFaces == 0) continue;
		if (0 < loader.animationset.size()) {
			if (m->skinweights.size() > 0) {
				weight = new CSkinWeights(loader, *m);
			}
		}
		if (0 < loader.animationset.size()) {
			for (unsigned int j = 0; j < m->skinweights.size(); j++) {
				CFrameBone *f = (CFrameBone*)CXFrame::getFrameByName(m->skinweights[j]->transformNodeName, pFrameRoot);
				f->seMatrixOffset(m->skinweights[j]->matrixOffset);
			}
		}
		pMeshList->push_back(new CMesh(loader, *m, weight));
		if (m->skinweights.size() > 0) {
			delete weight;
		}
	}
	return true;

}
コード例 #30
0
void KTLayer::pasteFrame(const int& index, const KTKeyFrame* copy)
{
	if(index == m_frames.count() )
	{
		createFrame(QString::null, true);
		m_frames.replace(index, new KTKeyFrame(*copy));
	}
	else if ( index > m_frames.count() )
	{
		for(int i = m_frames.count(); i <= index; i++)
		{ 
			createFrame(QString::null, true);
			m_frames.replace(i, new KTKeyFrame(*copy));
		}
	}
	else
	{
		m_frames.replace(index, new KTKeyFrame(*copy));
	}
}