示例#1
0
 void deleteContent()
 {
     QSGNode *subnode = firstChild();
     while (subnode) {
         // We can't delete the node now as it might be in the preprocess list
         // It will be deleted in the next preprocess
         m_nodes_to_delete.append(subnode);
         subnode = subnode->nextSibling();
     }
     removeAllChildNodes();
 }
示例#2
0
ExeTask:: ~ExeTask(void)
{
	//m_taskTAB는 실행전 외부에서 설정되는 것이기 때문에 여기서 지우면 안된다.
	//m_piAdapter로 외부에서 생성되어 전달된 것이라 외부에서 지운다.. 여기서 지우면 안된다.

	//if(m_startExeBehavior != NULL){
	//	delete m_startExeBehavior;
	//	m_startExeBehavior = NULL;
	//}

//	m_outModelTAB->clear();
//	delete m_outModelTAB;

	stopRunning();

	if(m_runner != NULL){ //삭제 순서도 중요함. m_logFile이 먼저삭제되면 안됨.
		delete m_runner;
		m_runner = NULL;
	}

	if(m_wVarTAB != NULL){ 
		m_wVarTAB->clear();
		delete m_wVarTAB;
		m_wVarTAB = NULL;
	}

	if(m_logFile != NULL){ 
		delete m_logFile;
		m_logFile = NULL;
	}

	//ExeTaskTreeNode의 소멸자에서 호출되지만 m_missionNodes와 같은 것을 참조하기 때문에
	//반드시 childnode를 삭제하고 m_mission을 삭제해야 하기 때문
	//(참고)상위 클래스의 소멸자는 나중에 호출됨
	//미리 recall대상이 빼야할 때 빠지고 없어야 하기 때문에 true로 설정
	removeAllChildNodes(true);
		
	if(m_missionNodes.size()>0){
		std::map<std::string, ExeTaskTreeNode*>::iterator mapiter;
		for(mapiter=m_missionNodes.begin(); mapiter!=m_missionNodes.end(); mapiter++){
			delete mapiter->second;
		}
	}
	m_missionNodes.clear();

	pthread_cond_destroy(&m_SLEEPstmt_wakeup_cond);
	pthread_mutex_destroy(&m_SLEEPstmt_wakeup_mu);

	//m_task는 TaskMem이 삭제될 때 삭제
	//m_outModelTAB은 TaskMem에서 삭제한다.
}
示例#3
0
//TODO updateMoons and destructor
void PlanetMoonsNode::updateMoons() {
    //In order to get the z-order right for the moons and the planet,
    //we need to first append the planet (both m_point and m_planetPic) then append all nodes for moons
    //that are nearer than the planet and then prepend nodes for moons that are further than the planet
    if(pmoons) {
        int nmoons = pmoons->nMoons();
        if(m_labelType == LabelsItem::label_t::NO_LABEL) {
            m_labelType = LabelsItem::label_t::JUPITER_MOON_LABEL;
        }

        if(!m_moonNodes.length()) { //Initialize PointSourceNodes used for drawing moons
            for ( int i=0; i<nmoons; ++i ) {
                m_moonNodes.append(new PointSourceNode(pmoons->moon(i), m_rootNode,m_labelType));
            }
        }

        removeAllChildNodes(); // Clear all child nodes so that we can render moons according to z-order

        // We need to reappend node that draws the planet
        appendChildNode(m_planetNode);

        bool drawLabel = true;

        if ( ! (Options::showPlanetNames() && Options::zoomFactor() > 50.*MINZOOM) ) {
            drawLabel = false;
        }

        for ( int i=0; i<nmoons; ++i ) {
            if ( pmoons->z(i) < 0.0 ) { //Moon is nearer than the planet
                appendChildNode(m_moonNodes[i]);
                m_moonNodes[i]->SkyNode::update(drawLabel);
            } else {
                //Draw Moons that are further than the planet
                //skyp->drawPointSource( pmoons->moon(i), pmoons->moon(i)->mag() );
                prependChildNode(m_moonNodes[i]);
                m_moonNodes[i]->SkyNode::update(drawLabel);
            }
        }

        /*  //Draw Moon name labels if at high zoom
     return;
    for ( int i=0; i<nmoons; ++i ) {

        if (planet ==KSPlanetBase::SATURN)
            SkyLabeler::AddLabel( pmoons->moon(i), SkyLabeler::SATURN_MOON_LABEL );
        else

        SkyLabeler::AddLabel( pmoons->moon(i), SkyLabeler::JUPITER_MOON_LABEL );
    }*/
    }
}
示例#4
0
void MultiTrackPlotter::setDataFormat( int channels, int frames )
{
    if (channels == m_channel_count && frames == m_frame_count)
        return;

    m_frame_count = frames;

    if (channels != m_channel_count)
    {
        m_channel_count = channels;

        removeAllChildNodes();

        for (int idx = 0; idx < m_channel_count; ++idx)
        {
            PlotNode1D *plotNode = new PlotNode1D;
            QSGTransformNode *transformNode = new QSGTransformNode;
            transformNode->appendChildNode(plotNode);
            this->appendChildNode(transformNode);
        }
    }

    updateTransform();
}