예제 #1
0
Property *CDSObject::AddProperty( Property *pProp )
{
    if (pProp)
    {
        // If this property is allowed multiple times in an object
        // e.g. Different sizes of artwork, then just insert it
        // Otherwise remove all existing instances of this property first
        // NOTE: This requires ALL instances of a property which can exist
        //       more than once to have m_bAllowMulti set to true.
        if (pProp->m_bMultiValue)
            m_properties.insertMulti(pProp->m_sName, pProp);
        else
        {
            Properties::iterator it = m_properties.find(pProp->m_sName);
            while (it != m_properties.end() && it.key() == pProp->m_sName)
            {
                delete *it;
                it = m_properties.erase(it);
            }
            m_properties[pProp->m_sName] = pProp;
        }
    }

    return pProp;
}
예제 #2
0
// hostDiv - the div where the trace data should be displayed
  // showTrace - indicates whether the trace should be shown by default (true) or whether the host will control
  //             when it is shown
processedTraceStream::processedTraceStream(properties::iterator props, std::string hostDiv, bool showTrace) : 
  traceStream(props.next(), hostDiv, showTrace)
{
  // Initialize the directories this processedTraceStream will use for its temporary storage
  static bool initialized=false;
  if(!initialized) {
    // Create the directory that holds the trace-specific scripts
    std::pair<std::string, std::string> dirs = dbg.createWidgetDir("procTS");
    workDir = dirs.first;
    maxFileID = 0;
  }
  
  queue = new traceObserverQueue();
  
  // Add this trace object as a change listener to all the context variables
  long numCmds = properties::getInt(props, "numCmds");
  for(long i=0; i<numCmds; i++) {
    commandProcessors.push_back(new externalTraceProcessor_File(props.get(txt()<<"cmd"<<i), txt()<<workDir<<"/in"<<(maxFileID++)));
    queue->push_back(commandProcessors.back());
  }
  // The final observer in the queue is the original traceStream, which accepts the observations and sends
  // them to be visualized
  queue->push_back(this);

  // Route all of this traceStream's observations through queue
  registerObserver(queue);
}
예제 #3
0
void
Properties::remove( const std::string& key )
{
    std::string nkey = normalize( key );
    for( Properties::iterator i = begin(); i != end(); i++ )
    {
        if ( i->getName() == nkey )
        {
            erase( i );
            return;
        }
    }
}
예제 #4
0
osg::Referenced*
Properties::getRefValue( const std::string& key )
{
    std::string nkey = normalize( key );
    for( Properties::iterator i = begin(); i != end(); i++ )
    {
        if ( i->getName() == nkey )
        {
            return i->getRefValue();
        }
    }
    return NULL;
}
예제 #5
0
QList<Property*> CDSObject::GetProperties( const QString &sName )
{
    QList<Property*> props;
    Properties::iterator it = m_properties.find(sName);
    while (it != m_properties.end() && it.key() == sName)
    {
        if (*it)
            props.append(*it);
        ++it;
    }

    return props;
}
예제 #6
0
graph::graph(properties::iterator props) : block(properties::next(props)) {
  dbg.enterBlock(this, false, true);
  //imgPath = dbg.addImage("svg");
  maxNodeID = 0;
  
  initEnvironment();  
    
  //graphID = maxGraphID;
  graphID = properties::getInt(props, "graphID");
  
  dbg.ownerAccessing();
  dbg << "<div id=\"graph_container_"<<graphID<<"\"></div>\n";
  //dbg << "<div id=\"debug_output\"></div>\n";
  dbg.userAccessing();
  
  // If the dot encoding of the graph is already provided, emit it immediately
  if(props.exists("dotText")) {
    outputCanvizDotGraph(properties::get(props, "dotText"));
    graphOutput = true;
  // Otherwise, wait to observe the nodes and edges of the graph before emitting it in the destructor
  } else
    graphOutput = false;
  
  //cout << "Entering graphID="<<graphID<<endl;
  
  // Add the current graph to the map of ative graphs
  active[graphID] = this;
}
예제 #7
0
// Sets a list of strings that denotes a unique ID according to which instances of this merger's 
// tags should be differentiated for purposes of merging. Tags with different IDs will not be merged.
// Each level of the inheritance hierarchy may add zero or more elements to the given list and 
// call their parents so they can add any info. Keys from base classes must precede keys from derived classes.
void ColorSelectorMerger::mergeKey(properties::tagType type, properties::iterator tag, 
                           std::map<std::string, streamRecord*>& inStreamRecords, std::list<std::string>& key) {
  Merger::mergeKey(type, tag.next(), inStreamRecords, key);
  
  if(type==properties::unknownTag) { cerr << "ERROR: inconsistent tag types when computing merge attribute key!"<<endl; exit(-1); }
  if(type==properties::enterTag) {
  }
}
예제 #8
0
// Sets a list of strings that denotes a unique ID according to which instances of this merger's 
// tags should be differentiated for purposes of merging. Tags with different IDs will not be merged.
// Each level of the inheritance hierarchy may add zero or more elements to the given list and 
// call their parents so they can add any info. Keys from base classes must precede keys from derived classes.
void ColorMerger::mergeKey(properties::tagType type, properties::iterator tag, 
                           std::map<std::string, streamRecord*>& inStreamRecords, std::list<std::string>& key) {
  Merger::mergeKey(type, tag.next(), inStreamRecords, key);
  
  if(type==properties::unknownTag) { cerr << "ERROR: inconsistent tag types when computing merge attribute key!"<<endl; exit(-1); }
  if(type==properties::enterTag) {
    // We only merge color annotations that correspond to the same colorSelector in the outgoing stream. 
    // ColorSelector IDs are merged when we enter them, which is guaranteed to have occured before
    // we process the color annotations associated with them.
    streamID inSID(properties::getInt(tag, "selID"), inStreamRecords["colorSelector"]->getVariantID());
    streamID outSID = ((ColorStreamRecord*)inStreamRecords["colorSelector"])->in2outID(inSID);
    key.push_back(txt()<<outSID.ID);
  }
}
예제 #9
0
// Sets a list of strings that denotes a unique ID according to which instances of this merger's 
// tags should be differentiated for purposes of merging. Tags with different IDs will not be merged.
// Each level of the inheritance hierarchy may add zero or more elements to the given list and 
// call their parents so they can add any info,
void SourceMerger::mergeKey(properties::tagType type, properties::iterator tag, 
                           std::map<std::string, streamRecord*>& inStreamRecords, MergeInfo& info) {
  ScopeMerger::mergeKey(type, tag.next(), inStreamRecords, info);
  
  if(type==properties::unknownTag) { cerr << "ERROR: inconsistent tag types when computing merge attribute key!"<<endl; exit(-1); }
  if(type==properties::enterTag) {
    info.add(properties::get(tag, "numRegions"));
    int numRegions = properties::getInt(tag, "numRegions");
    
    for(int i=0; i<numRegions; i++) {
      info.add(properties::get(tag, txt()<<"fName_"<<i));
      info.add(properties::get(tag, txt()<<"startLine_"<<i));
      info.add(properties::get(tag, txt()<<"endLine_"<<i));
    }
  }
}
예제 #10
0
// Sets a list of strings that denotes a unique ID according to which instances of this merger's 
// tags should be differentiated for purposes of merging. Tags with different IDs will not be merged.
// Each level of the inheritance hierarchy may add zero or more elements to the given list and 
// call their parents so they can add any info,
void CommBarMerger::mergeKey(properties::tagType type, properties::iterator tag, 
                           const std::map<std::string, streamRecord*>& inStreamRecords, MergeInfo& info) {
  UniqueMarkMerger::mergeKey(type, tag.next(), inStreamRecords, info);
}