当前位置: 首页>>代码示例>>C++>>正文


C++ Transition::GetDescription方法代码示例

本文整理汇总了C++中Transition::GetDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ Transition::GetDescription方法的具体用法?C++ Transition::GetDescription怎么用?C++ Transition::GetDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Transition的用法示例。


在下文中一共展示了Transition::GetDescription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sprintf

void TrajectoriesJPSV04::WriteGeometry(Building* building)
{
     // just put a link to the geometry file
     string embed_geometry;
     embed_geometry.append("\t<geometry>\n");
     char file_location[CLENGTH] = "";
     sprintf(file_location, "\t<file location= \"%s\"/>\n", building->GetGeometryFilename().c_str());
     embed_geometry.append(file_location);
     embed_geometry.append("\t</geometry>\n");
     //Write(embed_geometry);
     //return;
     //
     string geometry;
     geometry.append("\t<geometry>\n");

     bool plotHlines = true;
     bool plotCrossings = true;
     bool plotTransitions = true;
     bool plotPlayingField=false;
     vector<string> rooms_to_plot;
     unsigned int i;
     // first the rooms
     //to avoid writing navigation line twice
     vector<int> navLineWritten;
     //rooms_to_plot.push_back("U9");

     for (const auto& it:building->GetAllRooms())
     {
          auto&& r = it.second;
          string caption = r->GetCaption(); //if(r->GetID()!=1) continue;
          if (!rooms_to_plot.empty() && !IsElementInVector(rooms_to_plot, caption))
               continue;

          for(auto&& sitr: r->GetAllSubRooms())
          {
               auto&& s = sitr.second; //if(s->GetSubRoomID()!=7) continue;
               geometry.append(s->WriteSubRoom());

               // the hlines
               if (plotHlines) {
                    const vector<Hline*>& hlines = s->GetAllHlines();
                    for (i = 0; i < hlines.size(); i++) {
                         Hline* hline = hlines[i];
                         int uid1 = hline->GetUniqueID();
                         if (!IsElementInVector(navLineWritten, uid1)) {
                              navLineWritten.push_back(uid1);
                              if (rooms_to_plot.empty()
                                        || IsElementInVector(rooms_to_plot, caption)) {
                                   geometry.append(hline->GetDescription());
                              }
                         }
                    }

                    // the crossings
                    if (plotCrossings) {
                         const vector<Crossing*>& crossings = s->GetAllCrossings();
                         for (i = 0; i < crossings.size(); i++) {
                              Crossing* crossing = crossings[i];
                              int uid1 = crossing->GetUniqueID();
                              if (!IsElementInVector(navLineWritten, uid1)) {
                                   navLineWritten.push_back(uid1);
                                   if (rooms_to_plot.empty()
                                             || IsElementInVector(rooms_to_plot,
                                                       caption)) {
                                        geometry.append(crossing->GetDescription());
                                   }
                              }
                         }
                    }

                    // the transitions
                    if (plotTransitions) {
                         const vector<Transition*>& transitions =
                                   s->GetAllTransitions();
                         for (i = 0; i < transitions.size(); i++) {
                              Transition* transition = transitions[i];
                              int uid1 = transition->GetUniqueID();
                              if (!IsElementInVector(navLineWritten, uid1)) {
                                   navLineWritten.push_back(uid1);

                                   if (rooms_to_plot.empty()) {
                                        geometry.append(transition->GetDescription());

                                   } else {

                                        Room* room1 = transition->GetRoom1();
                                        Room* room2 = transition->GetRoom2();
                                        string caption1 = room1->GetCaption();
                                        if (room2) {
                                             string caption2 = room2->GetCaption();
                                             if (IsElementInVector(rooms_to_plot,
                                                       caption1)
                                                       || IsElementInVector(rooms_to_plot,
                                                                 caption2)) {
                                                  geometry.append(transition->GetDescription());
                                             }

                                        } else {
                                             if (IsElementInVector(rooms_to_plot,
                                                       caption1)) {
//.........这里部分代码省略.........
开发者ID:JuPedSim,项目名称:jpscore,代码行数:101,代码来源:IODispatcher.cpp


注:本文中的Transition::GetDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。