コード例 #1
0
void CqParseTreeViz::makeEdge(const T& node1, const U& node2, const char* fromTag)
{
	m_outStream << getNodeName(node1);
	if(fromTag != std::string(""))
		m_outStream << ":" << fromTag;
	m_outStream << " -> " << getNodeName(node2) << ";\n";
}
コード例 #2
0
  bool SlaterDetBuilder::put(xmlNodePtr cur)
  {
    ReportEngine PRE(ClassName,"put(xmlNodePtr)");

    ///save the current node
    xmlNodePtr curRoot=cur;
    bool success=true;
    cur = cur->children;
    string cname, tname;
    while(cur != NULL) 
    {
      getNodeName(cname,cur);
      if(cname == basisset_tag) 
      {
        if(myBasisSetFactory == 0) 
        {
          myBasisSetFactory = new BasisSetFactory(targetPtcl,targetPsi, ptclPool);
          myBasisSetFactory->setReportLevel(ReportLevel);
        }
        myBasisSetFactory->createBasisSet(cur,curRoot);
        //Children.push_back(bsFactory);
      } 
      else if(cname == sd_tag) 
      {
        int is=SlaterDetSet.size();
        //add a new SlaterDeterminant
        SlaterDetSet.push_back(new SlaterDeterminant_t);
        sdet_coeff.push_back(1.0);
        int firstIndex = 0;
        xmlNodePtr tcur = cur->children;
        while(tcur != NULL) {
          getNodeName(tname,tcur);
          if(tname == param_tag) {
            putContent(sdet_coeff[is],tcur);
          } else if(tname == det_tag) {
            firstIndex = putDeterminant(tcur, firstIndex);
          }
          tcur = tcur->next;
        }
      }
      cur = cur->next;
    }
    
    if(SlaterDetSet.empty()) 
    {
      //fatal
      PRE.error("Failed to create a SlaterDeterminant.",true);
      return false;
    }

    if(SlaterDetSet.size()>1)
      buildMultiSlaterDetermiant();
    else
      buildSlaterDetermiant();

    return success;
  }
コード例 #3
0
void tarch::parallel::messages::RegisterAtNodePoolMessage::toString (std::ostream& out) const {
   out << "("; 
   out << "nodeName:[";
   for (int i = 0; i < MPI_MAX_NAME_STRING_ADDED_ONE-1; i++) {
      out << getNodeName(i) << ",";
   }
   out << getNodeName(MPI_MAX_NAME_STRING_ADDED_ONE-1) << "]";
   out <<  ")";
}
コード例 #4
0
ファイル: dijkstra.c プロジェクト: ryukinix/dijkstra
int main(int argc, char *argv[]){
    int smallest;
    join_route(route, " -> ", ROUTE_SIZE);
    //printf("Len: %d\n", ilen(route));
    for (int i = 0; i < ROUTE_SIZE; i++) {
        char node = getNodeName(route[i]);
        print_routes(node, graph[route[i]]);
        int dist = min(graph[route[i]], &smallest);
        char neighbor = getNodeName(smallest);
        printf("Short distance: %c -> %c: %d\n\n", node, neighbor, dist);
    }
    return 0;
}
コード例 #5
0
void CX3DDirectionalLightNode::print(int indent)
{
	FILE *fp = CX3DParser::getDebugLogFp();

	char *nodeName = getNodeName();
	if (nodeName)
	{
		float r, g, b;
		float x, y, z;

		CX3DParser::printIndent(indent);
		fprintf(fp, "%s (%s)\n", nodeName, CX3DNode::getNodeTypeString(getNodeType()));

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "ambientIntensity : (%f)\n", getAmbientIntensity()->getValue());

		getColor()->getValue(r, g, b);
		CX3DParser::printIndent(indent+1);
		fprintf(fp, "color : (%f %f %f)\n", r, g, b);

		getDirection()->getValue(x, y, z);
		CX3DParser::printIndent(indent+1);
		fprintf(fp, "direction : (%f %f %f)\n", x, y, z);

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "intensity : (%f)\n", getIntensity()->getValue());

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "on : %s\n", getOn()->getValue() ? "TRUE" : "FALSE");

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "global : %s\n", getGlobal()->getValue() ? "TRUE" : "FALSE");
	}
}
コード例 #6
0
// helper function for retrieving the name and email address from an item
static void
getNameAndEmailAddress(
    Item& aEmailItem,
    String& aName,
    String& aMailbox,
    String& aHost)
{
    Iterator_t lChildren = aEmailItem.getChildren();
    lChildren->open();
    Item lChild;
    // name might not exist -> empty string by default
    aName = "";
    while (lChildren->next(lChild)) {
        if (lChild.getNodeKind() != store::StoreConsts::elementNode) {
            continue;
        }

        String lNodeName;
        getNodeName(lChild, lNodeName);
        if (lNodeName == "name") {
            aName = lChild.getStringValue();
        } else {
            String lEmail = lChild.getStringValue();
            int lIndexOfAt = lEmail.find('@');
            aMailbox = lEmail.substr(0, lIndexOfAt).c_str();
            aHost = lEmail.substr(lIndexOfAt + 1, lEmail.length() - lIndexOfAt - 1).c_str();
        }
    }
}
コード例 #7
0
short NAProcessHandle::getNodeNameLen()
{
    if (nodeNameLen_ == 0)
        getNodeName();

    return nodeNameLen_;
}
コード例 #8
0
const char* SGNODE::GetName( void )
{
    if( m_Name.empty() )
        getNodeName( m_SGtype, m_Name );

    return m_Name.c_str();
}
コード例 #9
0
void
CClientMimeHandler::body()
{
    theBody->type = TYPEOTHER;

    Iterator_t lChildIter;
    Item lChild;
    String lNodeName;

    lChildIter = theBodyItem.getChildren();
    lChildIter->open();
    while (lChildIter->next(lChild)) {
        if (lChild.getNodeKind() != store::StoreConsts::elementNode) {
            continue;
        }

        getNodeName(lChild, lNodeName);

        if (lNodeName == "content") {
            parse_content(theBody, lChild);
        }
        else if (lNodeName == "multipart") {
            parse_multipart(theBody, lChild);
        }
    }
    lChildIter->close();
}
コード例 #10
0
ファイル: XMLElement.cpp プロジェクト: ASP1234/Scilabv5.5.2
const std::string XMLElement::toString() const
{
    std::ostringstream oss;
    std::string ns = "";
    std::string prefix = "";

    if (node->ns)
    {
        if (node->ns->href)
        {
            ns = std::string((const char *)node->ns->href);
        }

        if (node->ns->prefix)
        {
            prefix = std::string((const char *)node->ns->prefix);
        }
    }

    oss << "XML Element" << std::endl
        << "name: " << getNodeName() << std::endl
        << "namespace: XML Namespace" << std::endl
        << "    href: " << ns << std::endl
        << "    prefix: " << prefix << std::endl
        << "type: " << nodes_type[getNodeType() - 1] << std::endl
        << "parent: XML Element" << std::endl
        << "attributes: [1 x " << XMLAttr::getSize(node->properties) << "]" << std::endl
        << "children: [1 x " << XMLNodeList::getNodeListSize(node->children) << "]" << std::endl
        << "content: ..." << std::endl
        << "line: " << node->line;

    return oss.str();
}
コード例 #11
0
ファイル: CX3DCylinderNode.cpp プロジェクト: Aharobot/Client
void CX3DCylinderNode::print(int indent)
{
	FILE *fp = CX3DParser::getDebugLogFp();

	char *nodeName = getNodeName();
	if (nodeName)
	{
		CX3DParser::printIndent(indent);
		fprintf(fp, "%s (%s)\n", nodeName, CX3DNode::getNodeTypeString(getNodeType()));

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "solid : %s\n", getSolid()->getValue() ? "TRUE" : "FALSE");

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "radius : (%f)\n", getRadius()->getValue());

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "height : (%f)\n", getHeight()->getValue());

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "bottom : %s\n", getBottom()->getValue() ? "TRUE" : "FALSE");

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "side : %s\n", getSide()->getValue() ? "TRUE" : "FALSE");

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "top : %s\n", getTop()->getValue() ? "TRUE" : "FALSE");
	}
}
コード例 #12
0
ファイル: CX3DNormalNode.cpp プロジェクト: Aharobot/Client
void CX3DNormalNode::print(int indent)
{
	FILE *fp = CX3DParser::getDebugLogFp();
	int nMax = CX3DParser::getMaxPrintElemsForMFField();
	bool bPartialPrint = false;

	char *nodeName = getNodeName();
	if (nodeName)
	{
		int i, n;

		CX3DParser::printIndent(indent);
		fprintf(fp, "%s (%s)\n", nodeName, CX3DNode::getNodeTypeString(getNodeType()));

		CX3DParser::printIndent(indent+1);
		n = m_vector.count();
		fprintf(fp, "vector [%d]\n", n);
		if ((nMax > 0) && (n > nMax)) { n = nMax; bPartialPrint = true; }
		else { bPartialPrint = false; }
		for (i=0; i<n; i++)
		{
			float x, y, z;
			
			m_vector.getValue(i).getValue(x, y, z);

			CX3DParser::printIndent(indent+2);
			fprintf(fp, "(%f %f %f)\n", x, y, z);
		}
		if (bPartialPrint)
		{
			CX3DParser::printIndent(indent+2);
			fprintf(fp, "...\n");
		}
	}
}
コード例 #13
0
void CX3DTextureTransformNode::print(int indent)
{
	FILE *fp = CX3DParser::getDebugLogFp();

	char *nodeName = getNodeName();
	if (nodeName)
	{
		float x, y;

		CX3DParser::printIndent(indent);
		fprintf(fp, "%s (%s)\n", nodeName, CX3DNode::getNodeTypeString(getNodeType()));

		getCenter()->getValue(x, y);
		CX3DParser::printIndent(indent+1);
		fprintf(fp, "center : (%f %f)\n", x, y);

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "rotation : %f\n", getRotation()->getValue());

		getScale()->getValue(x, y);
		CX3DParser::printIndent(indent+1);
		fprintf(fp, "scale : (%f %f)\n", x, y);

		getTranslation()->getValue(x, y);
		CX3DParser::printIndent(indent+1);
		fprintf(fp, "translation : (%f %f)\n", x, y);
	}
}
コード例 #14
0
    const std::string XMLElement::toString() const
    {
        std::ostringstream oss;
        std::string ns = "";
        std::string prefix = "";

        if (node->ns)
        {
            if (node->ns->href)
            {
                ns = std::string((const char *)node->ns->href);
            }

            if (node->ns->prefix)
            {
                prefix = std::string((const char *)node->ns->prefix);
            }
        }

        oss << "XML Element" << std::endl;
        oss << "name: " << getNodeName() << std::endl;
        oss << "namespace href: " << ns << std::endl;
        oss << "namespace prefix: " << prefix << std::endl;
        oss << "type: " << nodes_type[getNodeType() - 1] << std::endl;
        oss << "definition line: " << node->line;

        return oss.str();
    }
コード例 #15
0
ファイル: rollback.cpp プロジェクト: 4Evergreen4/minetest
const std::list<RollbackAction> RollbackManager::rollbackActionsFromActionRows(
		const std::list<ActionRow> & rows)
{
	std::list<RollbackAction> actions;

	for (std::list<ActionRow>::const_iterator it = rows.begin();
			it != rows.end(); ++it) {
		RollbackAction action;
		action.actor     = (it->actor) ? getActorName(it->actor) : "";
		action.unix_time = it->timestamp;
		action.type      = static_cast<RollbackAction::Type>(it->type);

		switch (action.type) {
		case RollbackAction::TYPE_MODIFY_INVENTORY_STACK:
			action.inventory_location = it->location.c_str();
			action.inventory_list     = it->list;
			action.inventory_index    = it->index;
			action.inventory_add      = it->add;
			action.inventory_stack    = it->stack;
			if (action.inventory_stack.name.empty()) {
				action.inventory_stack.name = getNodeName(it->stack.id);
			}
			break;

		case RollbackAction::TYPE_SET_NODE:
			action.p            = v3s16(it->x, it->y, it->z);
			action.n_old.name   = getNodeName(it->oldNode);
			action.n_old.param1 = it->oldParam1;
			action.n_old.param2 = it->oldParam2;
			action.n_old.meta   = it->oldMeta;
			action.n_new.name   = getNodeName(it->newNode);
			action.n_new.param1 = it->newParam1;
			action.n_new.param2 = it->newParam2;
			action.n_new.meta   = it->newMeta;
			break;

		default:
			throw ("W.T.F.");
			break;
		}

		actions.push_back(action);
	}

	return actions;
}
コード例 #16
0
ファイル: http.cpp プロジェクト: bluemagic-club/aseba
 void HttpInterface::nodeDescriptionReceived(unsigned nodeId)
 {
     if (verbose)
         wcerr << this << L"Received description for " << getNodeName(nodeId) << endl;
     if (!nodeId) return;
     this->nodeId = nodeId;
     nodeDescriptionComplete = true;
 }
コード例 #17
0
ファイル: dijkstra.c プロジェクト: ryukinix/dijkstra
void print_routes(char node, int edges[X]) {
    for (int i = 0; i < X; i++) {
        char neighbor = getNodeName(i);
        int distance = edges[i];
        printf("%c -> %c: ", node, neighbor);
        print_distance(distance);
    }
}
コード例 #18
0
/**
* !!! First call to stepToNextNode() must be preceeeded by a call to initStepToNextNode() !!!
**/
struct node_t* stepToNextNode(struct node_t* ptr, int stepNo, char* searchPath, int maxFound, int* foundResponses, path_t* responsePaths, long* foundNodePtrs) {
printf("ptr->name=%s, stepNo=%d, responsePaths[%d]=%s\n",ptr->name, stepNo, *foundResponses, responsePaths[*foundResponses]);
    if (*foundResponses >= maxFound-1)
        return NULL; // response buffers are full
    char pathNodeName[MAXNAMELEN];
    strncpy(pathNodeName, getNodeName(stepNo, searchPath), MAXNAMELEN);
    if (stepNo == stepsInPath) {
        if (strcmp(pathNodeName, ptr->name) == 0 || strcmp(pathNodeName, "*") == 0) {
            // at matching node, so save ptr and return success
            foundNodePtrs[*foundResponses] = (intptr_t)ptr;
            (*foundResponses)++;
            return ptr;
        }
    }
    strncpy(pathNodeName, getNodeName(stepNo+1, searchPath), MAXNAMELEN);  // get name of next step in path
    if (strcmp(pathNodeName, "*") != 0) {  // try to match with one of the children
        for (int i = 0 ; i < ptr->children ; i++) {
printf("ptr->child[i]->name=%s\n", ptr->child[i]->name);
            if (strcmp(pathNodeName, ptr->child[i]->name) == 0) {
                if (strlen(responsePaths[*foundResponses]) > 0) // always true?
                    strcat(responsePaths[*foundResponses], ".");
                strcat(responsePaths[*foundResponses], pathNodeName);
                return stepToNextNode(ptr->child[i], stepNo+1, searchPath, maxFound, foundResponses, responsePaths,  foundNodePtrs);
            }
        }
        return NULL;
    } else {  // wildcard, try to match with all children
        struct node_t* responsePtr = NULL;
        for (int i = 0 ; (i < ptr->children) && (*foundResponses < maxFound) ; i++) {
printf("Wildcard:ptr->child[%d]->name=%s\n", i, ptr->child[i]->name);
            strcat(responsePaths[*foundResponses], ".");
            strcat(responsePaths[*foundResponses], ptr->child[i]->name);
            struct node_t* ptr2 = stepToNextNode(ptr->child[i], stepNo+1, searchPath, maxFound, foundResponses, responsePaths,  foundNodePtrs);
            if (ptr2 == NULL) {
                copySteps(responsePaths[*foundResponses], responsePaths[*foundResponses], stepNo+1);
            } else {
                if (i < ptr->children && foundNodePtrs[*foundResponses-1] != 0) {
                    copySteps(responsePaths[*foundResponses], responsePaths[*foundResponses-1], stepNo+1);
                } else
                    copySteps(responsePaths[*foundResponses], responsePaths[*foundResponses], stepNo+1);
                responsePtr = ptr2;
            }
        }
        return responsePtr;
    }
}
コード例 #19
0
ファイル: rollback.cpp プロジェクト: Caellian/minetest
const std::list<RollbackAction> RollbackManager::rollbackActionsFromActionRows(
		const std::list<ActionRow> & rows)
{
	std::list<RollbackAction> actions;

	for (const ActionRow &row : rows) {
		RollbackAction action;
		action.actor     = (row.actor) ? getActorName(row.actor) : "";
		action.unix_time = row.timestamp;
		action.type      = static_cast<RollbackAction::Type>(row.type);

		switch (action.type) {
		case RollbackAction::TYPE_MODIFY_INVENTORY_STACK:
			action.inventory_location = row.location;
			action.inventory_list     = row.list;
			action.inventory_index    = row.index;
			action.inventory_add      = row.add;
			action.inventory_stack    = row.stack;
			if (action.inventory_stack.name.empty()) {
				action.inventory_stack.name = getNodeName(row.stack.id);
			}
			break;

		case RollbackAction::TYPE_SET_NODE:
			action.p            = v3s16(row.x, row.y, row.z);
			action.n_old.name   = getNodeName(row.oldNode);
			action.n_old.param1 = row.oldParam1;
			action.n_old.param2 = row.oldParam2;
			action.n_old.meta   = row.oldMeta;
			action.n_new.name   = getNodeName(row.newNode);
			action.n_new.param1 = row.newParam1;
			action.n_new.param2 = row.newParam2;
			action.n_new.meta   = row.newMeta;
			break;

		default:
			throw ("W.T.F.");
			break;
		}

		actions.push_back(action);
	}

	return actions;
}
コード例 #20
0
void SGNODE::SetName( const char *aName )
{
    if( NULL == aName || 0 == aName[0] )
        getNodeName( m_SGtype, m_Name );
    else
        m_Name = aName;

    return;
}
コード例 #21
0
const DOMStringType
XercesDOM_ElementHack::getNodeNameImpl() const
{
#if defined(XALAN_USE_XERCES_INTERNAL_CLASSES)
	return getImpl()->getNodeName();
#else
	return getNodeName();
#endif
}
コード例 #22
0
ファイル: node.cpp プロジェクト: mcdooda/nodescript
void Node::debugPrintPins() const
{
	std::cerr << "Node: " << getNodeName() << std::endl;
	int numPins = static_cast<int>(m_pinTypeIds.size());
	for (PinIndex pinIndex = 0; pinIndex < numPins; ++pinIndex)
	{
		std::cerr << "pin#" << pinIndex << " \"" << getPinName(pinIndex) << "\": " << debugGetPinType(pinIndex) << std::endl;
	}
	std::cerr << std::endl;
}
コード例 #23
0
/** set attributes of the node that represents this class
 * in the XMI document.
 */
void XMLElementCodeBlock::setAttributesOnNode ( QDomDocument & doc, QDomElement & docElement)
{

    // superclass call
    HierarchicalCodeBlock::setAttributesOnNode(doc,docElement);

    // now set local attributes/fields
    docElement.setAttribute("nodeName",getNodeName());

}
コード例 #24
0
// -----------------------------------------------------------------------
// Used by the internal SHOWPLAN command to get attributes of a TDB in a
// string.
// -----------------------------------------------------------------------
NA_EIDPROC void ComTdb::displayContents(Space * space,ULng32 flag)
{

#ifndef __EID
  char buf[100];
  str_sprintf(buf, "Contents of %s [%d]:", getNodeName(),getExplainNodeId());
  Int32 j = str_len(buf);
  space->allocateAndCopyToAlignedSpace(buf, j, sizeof(short));
  for (Int32 k = 0; k < j; k++) buf[k] = '-';
  buf[j] = '\n';
  buf[j+1] = 0;
  space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));

  if(flag & 0x00000008)
    {
  		str_sprintf(buf,"For ComTdb :");
		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));

		str_sprintf(buf,"Class Version = %d, Class Size = %d",
                  getClassVersionID(),getClassSize());
  		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));

  		str_sprintf(buf,"InitialQueueSizeDown = %d, InitialQueueSizeUp = %d",
                   getInitialQueueSizeDown(),getInitialQueueSizeUp());
  		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));

  		str_sprintf(buf,"queueResizeLimit = %d, queueResizeFactor = %d",
                     getQueueResizeLimit(),getQueueResizeFactor());
  		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));

  		str_sprintf(buf, "queueSizeDown = %d, queueSizeUp = %d, numBuffers = %d, bufferSize = %d",
	        getMaxQueueSizeDown(), getMaxQueueSizeUp(), numBuffers_, bufferSize_);
  		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));

  		str_sprintf(buf, "estimatedRowUsed = %f, estimatedRowsAccessed = %f, expressionMode = %d", 
                  estRowsUsed_, estRowsAccessed_, expressionMode_);
  		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));

  		str_sprintf(buf, "Flag = %b",flags_);
  		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));

  		if (firstNRows() >= 0)
    		{
      		str_sprintf(buf, "Request Type: GET_N (%d) ", firstNRows());
      		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
    		}
    }
 #endif

  if(flag & 0x00000001)
    {
      displayExpression(space,flag);
      displayChildren(space,flag);
    }
}
コード例 #25
0
ファイル: dijkstra.c プロジェクト: ryukinix/dijkstra
void join_route(int *route, const char *string, int size) {
    printf("Route: ");
    for (int i = 0; i < size; i++) {
        char node = getNodeName(route[i]);
        printf("%c", node);
        if (i + 1 < size) {
            printf("%s", string);
        }
    }
    printf("\n");
}
コード例 #26
0
ファイル: graphData.cpp プロジェクト: 13572293130/XOgastan
void 
graphData::dumpDotFile(const char *fileName, const char *shape) {
  ofstream                      fout;   // the ouput file
  list <node *>::iterator       p;      // browse the list
  node                          *n;     // a node

  fout.open(fileName);
  
  fout << "digraph G {\n\n\tnode "
       << "[style=filled, shape=" << shape << ", heigth=.3]\n\n";

  //write the nodes 
  for (p = nodesL.begin(); p != nodesL.end(); p++) {
    n = *p;

    fout << "\t" << n->name << "_" << n->id
	 << "[color=";
    switch (n->c) {
    case yellow: fout << "yellow"; break;
    case cyan: fout << "cyan"; break;
    case green: fout << "green"; break;
    case red: fout << "red"; break;
    default: fout << "yellow"; break;
    }     
    fout << "]\n";

  }
  fout << "\n\n";


  // write the edges 
  for (p = nodesL.begin(); p != nodesL.end(); p++) {
    typedef multimap<int, outEdge *>::iterator MI;
    pair<MI,MI>         p2;      // lower and upper limits

    n = *p;
    p2 = edgesMM.equal_range(n->id);
    for (MI q = p2.first; q != p2.second; ++q) {
      outEdge      *oe = q->second;
      
      fout << "\t" << n->name << "_" << n->id 
	   << "->" << getNodeName(oe->to)  << "_" << oe->to
	   << "[label=\"" << oe->label << "\"]\n";
    }
  }
  fout << "\n\n}";

  fout.close();

  return;
}
コード例 #27
0
ファイル: CX3DHAnimSiteNode.cpp プロジェクト: Aharobot/Client
void CX3DHAnimSiteNode::print(int indent)
{
	FILE *fp = CX3DParser::getDebugLogFp();

	char *nodeName = getNodeName();
	if (nodeName)
	{
		float x, y, z, rot;
		int i, n;

		CX3DParser::printIndent(indent);
		fprintf(fp, "%s (%s)\n", nodeName, CX3DNode::getNodeTypeString(getNodeType()));

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "children\n");
		MFNode *nodes = getChildren();
		n = nodes->count();
		for (i=0; i<n; i++)
		{
			CX3DNode *child = nodes->getNode(i);
			if (child)
			{
				child->print(indent+2);
			}
		}

		CX3DParser::printIndent(indent+1);
		getCenter()->getValue(x, y, z);
		fprintf(fp, "center : (%f %f %f)\n", x, y, z);

		CX3DParser::printIndent(indent+1);
		getRotation()->getValue(x, y, z, rot);
		fprintf(fp, "rotation : (%f %f %f)(%f)\n", x, y, z, rot);

		CX3DParser::printIndent(indent+1);
		getScale()->getValue(x, y, z);
		fprintf(fp, "scale : (%f %f %f)\n", x, y, z);

		CX3DParser::printIndent(indent+1);
		getScaleOrientation()->getValue(x, y, z, rot);
		fprintf(fp, "scaleOrientation : (%f %f %f)(%f)\n", x, y, z, rot);

		CX3DParser::printIndent(indent+1);
		getTranslation()->getValue(x, y, z);
		fprintf(fp, "translation : (%f %f %f)\n", x, y, z);

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "name (%s)\n", m_name.getValue());
	}
}
コード例 #28
0
ファイル: ExeTask.cpp プロジェクト: OPRoS/TaskEngine
int ExeTask::execute()
{	
	m_stop = false;
	m_running = true;
	m_joining = false;
	nodeStart();

	this->create_thr(RThread::ATTACH, getNodeName());
	if(m_runner->isDebugMode()||m_runner->isMonitorMode()){
		this->sendThreadInfo("new");
		m_runner->addCondMu4BP(getThreadNum());
		m_isDbgCondCreated = true;
	}

	return 0;
}
コード例 #29
0
void CX3DSphereNode::print(int indent)
{
	FILE *fp = CX3DParser::getDebugLogFp();

	char *nodeName = getNodeName();
	if (nodeName)
	{
		CX3DParser::printIndent(indent);
		fprintf(fp, "%s (%s)\n", nodeName, CX3DNode::getNodeTypeString(getNodeType()));

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "solid  : %s\n", getSolid()->getValue() ? "TRUE" : "FALSE");

		CX3DParser::printIndent(indent+1);
		fprintf(fp, "radius : (%f)\n", getRadius()->getValue());
	}
}
コード例 #30
0
ファイル: node.cpp プロジェクト: mcdooda/nodescript
void Node::optimize()
{
	#ifdef NODESCRIPT_DEBUG
	int gain = m_pinTypeIds.capacity() * sizeof(PinTypeId);
	#endif
	m_pinTypeIds.shrink_to_fit();
	#ifdef NODESCRIPT_DEBUG
	gain -= m_pinTypeIds.capacity() * sizeof(PinTypeId);
	gain += m_inputPinDefaultValues.capacity() * sizeof(PinValue);
	#endif
	m_inputPinDefaultValues.shrink_to_fit();
	#ifdef NODESCRIPT_DEBUG
	gain -= m_inputPinDefaultValues.capacity() * sizeof(PinValue);
	#endif
	
	#if defined(NODESCRIPT_VERBOSE) && defined(NODESCRIPT_DEBUG)
	std::cerr << "[node " << getNodeName() << "] we won " << gain << " bytes" << std::endl;
	#endif
}