void ramBaseApp::drawNodeArrays()
{
	// draw nodearray

	for (int n = 0; n < getNumNodeArray(); n++)
	{
		const ramNodeArray &o = getNodeArray(n);

		if (o.isActor())
			drawActor((ramActor &)o);
		else
			drawRigid((ramRigidBody &)o);
	}

	// draw bus

	map<string, ramNodeArray>::iterator it = getActorManager().getAllBus().begin();

	while (it != getActorManager().getAllBus().end())
	{
		const ramNodeArray &o = (*it).second;

		if (o.isActor())
			drawActor((ramActor &)o);
		else
			drawRigid((ramRigidBody &)o);

		++it;
	}
}
Example #2
0
// This function is not requied since the base class function is available and is preferred (for conformity).
std::string
CompassAnalyses::FunctionDefinitionPrototype::CheckerOutput::getString() const
{
     ROSE_ASSERT(getNodeArray().size() <= 1);

  // Default implementation for getString
     SgLocatedNode* locatedNode = isSgLocatedNode(getNode());
     std::string sourceCodeLocation;
     if (locatedNode != NULL)
        {
          Sg_File_Info* start = locatedNode->get_startOfConstruct();
          Sg_File_Info* end   = locatedNode->get_endOfConstruct();
          sourceCodeLocation = (end ? Compass::formatStandardSourcePosition(start, end) 
                                    : Compass::formatStandardSourcePosition(start));
       }
      else
       {
      // Else this could be a SgInitializedName or SgTemplateArgument (not yet moved to be a SgLocatedNode)
         Sg_File_Info* start = getNode()->get_file_info();
         ROSE_ASSERT(start != NULL);
         sourceCodeLocation = Compass::formatStandardSourcePosition(start);
       }

     std::string nodeName = getNode()->class_name();

  // The short description used here needs to be put into a separate function (can this be part of what is filled in by the script?)
  // return loc + ": " + nodeName + ": variable requiring static constructor initialization";

     return m_checkerName + ": " + sourceCodeLocation + ": " + nodeName + ": " + m_shortDescription + ".\n\"" + what + "\" does not have a prototype";
} //CompassAnalyses::FunctionDefinitionPrototype::CheckerOutput::getString()
void ramActorsScene::update()
{
    /// refresh control panel if it's needed
	if (needsUpdatePanel())
		rebuildControlPanel();
	
    
	SegmentsIter it = mSegmentsMap.begin();
	
	while (it != mSegmentsMap.end())
	{
		BaseSegment *seg = it->second;
		
		/// position reset
		if (seg->bNeedsResetPos)
		{
			seg->position = ofPoint::zero();
			seg->bNeedsResetPos = false;
		}
        
        /// realtime osc data
        if (seg->getType() == RAM_UI_SEGMENT_TYPE_CONTROL)
        {
            seg->session.filter( getNodeArray(it->first) );
        }
        /// recording data playback
        else if (seg->getType() == RAM_UI_SEGMENT_TYPE_PLAYBACK)
        {
            if (static_cast<PlaybackSegment*>(seg)->isPlaying())
            {
                seg->session.updatePlayhead();
                
                ramNodeArray NA = seg->session.getCurrentFrame();
                NA.setPlayback(true);
                NA.setTimestamp(ofGetElapsedTimef());
                getActorManager().instance().setNodeArray(NA);
            }
        }
		
		it++;
	}
}
void ramBaseApp::drawNodeArrays()
{
	// draw nodearray

	for (int n = 0; n < getNumNodeArray(); n++)
	{
		const ramNodeArray &o = getNodeArray(n);
		
		glPushAttrib(GL_ALL_ATTRIB_BITS);
		glPushMatrix();
		ofPushStyle();
		if (o.isActor())
			drawActor((ramActor &)o);
		else
			drawRigid((ramRigidBody &)o);
		
		ofPopStyle();
		glPopMatrix();
		glPopAttrib();
	}

	// draw bus

	map<string, ramNodeArray>::iterator it = getActorManager().getAllBus().begin();

	while (it != getActorManager().getAllBus().end())
	{
		const ramNodeArray &o = (*it).second;
		
		glPushAttrib(GL_ALL_ATTRIB_BITS);
		glPushMatrix();
		ofPushStyle();
		if (o.isActor())
			drawActor((ramActor &)o);
		else
			drawRigid((ramRigidBody &)o);
		ofPopStyle();
		glPopMatrix();
		glPopAttrib();
		++it;
	}
}
void ramActorsScene::draw()
{
    ///
	bRecording = false;
    
    ///
    ramBeginCamera();

	for(int i=0; i<getNumNodeArray(); i++)
	{
		ramNodeArray &NA = getNodeArray(i);
		
		const string name = NA.getName();
		
		SegmentsIter it = mSegmentsMap.find(name);
		
		if (it == mSegmentsMap.end())
			continue;
		
		BaseSegment *seg = it->second;
		
		/// draw if "Show actor" toggle is anabled
		// note that ofxUIImageToggle shows hilighted image when it's false,
        if (seg->isVisible())
		{
			ofPushMatrix();
			ofPushStyle();
			{
				
				if (bUseShading) light.enable();
				
				ofSetColor(seg->jointColor);
				ofTranslate(seg->position.x, 0, seg->position.y);
				
				if (NA.isRigid())
				{
					ramDrawBasicRigid((ramRigidBody&)NA);
				}
				else
				{
					if (bUseSimpleActor)
                        ramDrawBasicActor((ramActor&)NA);
					else
                        drawNodes(NA);
				}
				
				if (bUseShading) light.disable();
			}
			ofPopStyle();
			ofPopMatrix();
		}
		
		if (seg->getType() == RAM_UI_SEGMENT_TYPE_CONTROL)
        {
            if (static_cast<ControlSegment*>(seg)->isRecording())
            {
                bRecording = true;
            }
        }
	}
    ramEndCamera();
}