Sink&
 Sink::operator<< (const RawMessage& m)
   throw (ZmqErrorType)
 {
   if (m.deleter)
   {
     Part part(m.data.ptr, m.sz, m.deleter, m.hint);
     send_owned(part);
   }
   else
   {
     Part part;
     init_msg(m.data.cptr, m.sz, part.msg());
     send_owned(part);
   }
   return *this;
 }
Example #2
0
void Song::cmdGluePart(Track* track, Part* oPart)
{
    PartList* pl = track->parts();
    Part* nextPart = 0;

    for (iPart ip = pl->begin(); ip != pl->end(); ++ip)
    {
        if (ip->second == oPart)
        {
            ++ip;
            if (ip == pl->end())
                return;
            nextPart = ip->second;
            break;
        }
    }

    Part* nPart = track->newPart(oPart);
    nPart->setLenTick(nextPart->tick() + nextPart->lenTick() - oPart->tick());

    // populate nPart with Events from oPart and nextPart

    EventList* sl1 = oPart->events();
    EventList* dl = nPart->events();

    for (iEvent ie = sl1->begin(); ie != sl1->end(); ++ie)
        dl->add(ie->second);

    EventList* sl2 = nextPart->events();

    //int frameOffset = nextPart->frame() - oPart->frame();
    //for (iEvent ie = sl2->begin(); ie != sl2->end(); ++ie) {
    //      Event event = ie->second.clone();
    //      event.setFrame(event.frame() + frameOffset);
    //      dl->add(event);
    //      }
    // p3.3.54 Changed.

    {
        int tickOffset = nextPart->tick() - oPart->tick();
        for (iEvent ie = sl2->begin(); ie != sl2->end(); ++ie)
        {
            Event event = ie->second.clone();
            event.setTick(event.tick() + tickOffset);
            dl->add(event);
        }
    }

    startUndo();
    audio->msgRemovePart(nextPart, false);
    // Indicate no undo, and do port controller values but not clone parts.
    //audio->msgChangePart(oPart, nPart, false);
    audio->msgChangePart(oPart, nPart, false, true, false);
    endUndo(SC_PART_MODIFIED | SC_PART_REMOVED);
}
Example #3
0
	void TestScene::CreateOnionSkins()
	{
		// current part
		Part *editPart = &currentAnimation->parts[selectedPartIndex];
		if (editPart)
		{
			Entity *editEntity = editPart->entity;
			Sprite *editSprite = editPart->sprite;

			int currentFrame = int(animationFrame);
			
			const int numFramesToPreview = 5;

			for (int i = 0; i < numFramesToPreview; i++)
			{
				int prevFrame = SafeFrameRange(currentFrame - i);
				int nextFrame = SafeFrameRange(currentFrame + i);

				const float dyeP = 0.25f;

				if (prevFrame != currentFrame)
				{
					Entity *entity = editPart->CreateEntity(textureSheet);
					eAnimation->Add(entity);
					editPart->ApplyFrameToEntity(prevFrame, entity);
					onionSkins.push_back(entity);
					float oldA = entity->color.a;
					entity->color = entity->color * (1.0f-dyeP) + Color::blue * dyeP;
					entity->color.a = oldA * (0.25f - 0.05f*i);
				}

				if (nextFrame != currentFrame)
				{
					// spawn part at next frame
					Entity *entity = editPart->CreateEntity(textureSheet);
					eAnimation->Add(entity);
					editPart->ApplyFrameToEntity(nextFrame, entity);
					onionSkins.push_back(entity);
					float oldA = entity->color.a;
					entity->color = entity->color * (1.0f-dyeP) + Color::red * dyeP;
					entity->color.a = oldA * (0.25f - 0.05f*i);
				}
			}
		}
	}
Example #4
0
static bool set_clear(const char *pname, const char **args) {
	Part *part = get_part(pname);
	if(part && args[0]) {
		bool enable;
		if(!strcmp(args[0], "true")) {
			enable = true;
		} else if(!strcmp(args[0], "false")) {
			enable = false;
		} else {
			return false;
		}

		info("set_clear(%s, %s)", pname, enable ? "true" : "false");
		part->set_clear(enable);
		return true;
	}
	return false;
}
Example #5
0
void get_part_and_all_subsets(const Part& part, ConstPartVector& part_and_all_subsets)
{
    insert(part_and_all_subsets, part);

    const PartVector& subsets = part.subsets();
    for(size_t i=0; i<subsets.size(); ++i) {
        get_part_and_all_subsets(*subsets[i], part_and_all_subsets);
    }
}
void PartController::Edit(const int partId, QWidget *caller)
{
    Part part;
    try { Databases::parts().findRecord("id", partId); }
    catch (const std::exception &e)
    {
        showErrorDialog(e.what());
        return;
    }

    if (part.null())
    {
        showErrorDialog(("Part with ID " + toString(partId) + " could not be found").c_str());
        return;
    }

    Edit(part, caller);
}
Example #7
0
void Chain::Output (ostream& os) const 
{
	os << "\n5'	---- ";

	int numP = listOfParts.size ();
	for (int cnt =0; cnt < numP; cnt++)
	{
		Part* p = listOfParts[cnt];
		os << "\n			" <<  p->getPartRef ();

	    if (p->isBinded) os << "*";

		os << "(" << p->getPartType () 
		   << "," << p->getPartLabel () 
		   << ")  " ;
	}
	os << "\n----	3'";
}
    void testNoteAccidentals()
    {
        Sheet* sheet = new Sheet();
        Bar* bar = sheet->addBar();
        Part* part = sheet->addPart("part");
        Voice* voice = part->addVoice();
        Staff* staff = part->addStaff();
        VoiceBar* vb = bar->voice(voice);

        for (int a = -2; a <= 2; a++) {
            Chord* c = new Chord(QuarterNote);
            c->addNote(staff, 0, a);
            vb->addElement(c);
        }

        validateOutput(sheet, "noteaccidentals.xml");
        delete sheet;
    }
    void testNotePitch()
    {
        Sheet* sheet = new Sheet();
        Bar* bar = sheet->addBar();
        Part* part = sheet->addPart("part");
        Voice* voice = part->addVoice();
        Staff* staff = part->addStaff();
        VoiceBar* vb = bar->voice(voice);

        for (int p = -20; p <= 20; p++) {
            Chord* c = new Chord(QuarterNote);
            c->addNote(staff, p);
            vb->addElement(c);
        }

        validateOutput(sheet, "notepitch.xml");
        delete sheet;
    }
Example #10
0
void MixerDetails::partNameChanged()
      {
      if (!_mti)
            return;

      QString text = partNameLineEdit->text();
      Part* part = _mti->part();
      if (part->partName() == text) {
            return;
            }

      Score* score = part->score();
      if (score) {
            score->startCmd();
            score->undo(new ChangePart(part, part->instrument(), text));
            score->endCmd();
            }
      }
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void QSRSnippetWidget::showModelStatistics()
{
    RenderSequence* renderSeq = m_snippet->renderSequence();
    CVF_ASSERT(renderSeq);

    size_t totPartCount = 0;
    size_t totFaceCount = 0;

    int numRenderings = renderSeq->renderingCount();
    int ir;
    for (ir = 0; ir < numRenderings; ir++)
    {
        Rendering* rendering = renderSeq->rendering(ir);
        CVF_ASSERT(rendering);

        Scene* scene = rendering->scene();
        CVF_ASSERT(scene);

        int numModels = scene->modelCount();
        int im;
        for (im = 0; im < numModels; im++)
        {
            Model* model = scene->model(im);

            Collection<Part> allParts;
            model->allParts(&allParts);

            size_t numParts = allParts.size();
            size_t ip;
            for (ip = 0; ip < numParts; ip++)
            {
                Part* part = allParts[ip].p();
                Drawable* drawable = part->drawable();

                totPartCount++;
                totFaceCount += drawable->faceCount();
            }
        }
    }    

    cvf::Trace::show("Total number of parts: %ld", totPartCount);
    cvf::Trace::show("Total number of faces: %ld", totFaceCount);
}
Example #12
0
void MixerDetails::setVoiceMute(int staffIdx, int voice, bool shouldMute)
      {
      Part* part = _mti->part();
      Staff* staff = part->staff(staffIdx);
      switch (voice) {
            case 0:
                  staff->undoChangeProperty(Pid::PLAYBACK_VOICE1, !shouldMute);
                  break;
            case 1:
                  staff->undoChangeProperty(Pid::PLAYBACK_VOICE2, !shouldMute);
                  break;
            case 2:
                  staff->undoChangeProperty(Pid::PLAYBACK_VOICE3, !shouldMute);
                  break;
            case 3:
                  staff->undoChangeProperty(Pid::PLAYBACK_VOICE4, !shouldMute);
                  break;
            }
      }
Example #13
0
Undo movePartsTotheRight(unsigned int startTicks, int moveTicks, bool only_selected, set<Track*>* tracklist)
{
      if (moveTicks<=0)
            return Undo();

      Undo operations;
      TrackList* tracks = MusEGlobal::song->tracks();
      
      for (iTrack it = tracks->begin(); it != tracks->end(); ++it) {
            Track* track = *it;
            if ( (track == 0) ||
                 (only_selected && !track->selected()) ||
                 (tracklist && tracklist->find(track)==tracklist->end()) )
                  continue;
            PartList* pl = track->parts();
            for (riPart p = pl->rbegin(); p != pl->rend(); ++p) {
                  Part* part = p->second;
                  unsigned t = part->tick();
                  int l = part->lenTick();
                  if (t + l <= startTicks)
                        continue;
                  if (startTicks > t && startTicks < (t+l)) {
                        // split part to insert new space
                        Part* p1;
                        Part* p2;
                        part->splitPart(startTicks, p1, p2);
                        p2->setTick(startTicks+moveTicks);

                        MusEGlobal::song->informAboutNewParts(part,p1,p2);
                        operations.push_back(UndoOp(UndoOp::DeletePart, part));
                        operations.push_back(UndoOp(UndoOp::AddPart, p1));
                        operations.push_back(UndoOp(UndoOp::AddPart, p2));
                        }
                  else if (t >= startTicks) {
                        operations.push_back(UndoOp(UndoOp::ModifyPartTick, part, part->tick(), t + moveTicks));
                        }
                  }
            }

      adjustGlobalLists(operations, startTicks, moveTicks);

      return operations;
      }
bool PartController::Destroy(Part &part, QWidget *caller)
{
    if (Destroy(part.getId(), caller))
    {
        part = Part();
        return true;
    }

    return false;
}
Example #15
0
bool Bucket::member( const Part & part ) const
{
  const unsigned * const i_beg = key() + 1 ;
  const unsigned * const i_end = key() + key()[0] ;

  const unsigned ord = part.mesh_meta_data_ordinal();
  const unsigned * const i = std::lower_bound( i_beg , i_end , ord );

  return i_end != i && ord == *i ;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST(ModelBasicListTest, MergeParts)
{
    Vec3fArray* verts = new Vec3fArray;
    verts->reserve(3);
    verts->add(Vec3f(0, 0, 0));
    verts->add(Vec3f(1, 0, 0));
    verts->add(Vec3f(1, 1, 0));

    Vec3fArray* norms = new Vec3fArray;
    norms->resize(3);
    norms->set(0, Vec3f::Z_AXIS);
    norms->set(1, Vec3f::Z_AXIS);
    norms->set(2, Vec3f::Z_AXIS);

    DrawableGeo* myGeo = new DrawableGeo;
    myGeo->setFromTriangleVertexArray(verts);
    myGeo->setNormalArray(norms);

    Part* myPart = new Part;
    myPart->setDrawable(myGeo);

    Part* myPart2 = new Part;
    myPart2->setDrawable(myGeo);

    ref<ModelBasicList> myModel = new ModelBasicList;
    myModel->addPart(myPart);
    myModel->addPart(myPart2);
    EXPECT_EQ(2, myModel->partCount());

    myModel->mergeParts(1000, 1000);
    EXPECT_EQ(1, myModel->partCount());

    Part* mergedPart = myModel->part(0);

    DrawableGeo* mergedGeo = dynamic_cast<DrawableGeo*>(mergedPart->drawable());
    const Vec3fArray* vertices = mergedGeo->vertexArray();
    EXPECT_EQ(6, vertices->size());

    Vec3f v5 = vertices->get(5);
    EXPECT_EQ(1, v5.x());
    EXPECT_EQ(1, v5.y());
    EXPECT_EQ(0, v5.z());
}
Example #17
0
void MsScWriter::header(const QString title, const QString type,
                        const QString composer, const QString footer,
                        const unsigned int temp)
      {
      qDebug() << "MsScWriter::header()"
               << "title:" << title
               << "type:" << type
               << "composer:" << composer
               << "footer:" << footer
               << "temp:" << temp
      ;

      // save tempo for later use
      tempo = temp;

      if (!title.isEmpty()) score->setMetaTag("workTitle", title);
      // TODO re-enable following statement
      // currently disabled because it breaks the bww iotest
      // if (!type.isEmpty()) score->setMetaTag("workNumber", type);
      QString strType = "composer";
      QString strComposer = composer; // TODO: const parameters ctor MusicXmlCreator
      score->addCreator(new MusicXmlCreator(strType, strComposer));
      if (!footer.isEmpty()) score->setMetaTag("copyright", footer);

      //  score->setWorkTitle(title);
      VBox* vbox  = 0;
      addText(vbox, score, title, TEXT_STYLE_TITLE);
      addText(vbox, score, type, TEXT_STYLE_SUBTITLE);
      addText(vbox, score, composer, TEXT_STYLE_COMPOSER);
      // addText(vbox, score, strPoet, TEXT_STYLE_POET);
      // addText(vbox, score, strTranslator, TEXT_STYLE_TRANSLATOR);
      if (vbox) {
            vbox->setTick(0);
            score->measures()->add(vbox);
            }
      if (!footer.isEmpty())
            score->style()->set(ST_oddFooterC, footer);

      Part* part = score->part(0);
      part->setLongName(instrumentName());
      part->setMidiProgram(midiProgram() - 1);
      }
Example #18
0
void MixerTrackPart::updateNameLabel()
      {
      Part* part = _mti->part();
      Channel* chan = _mti->focusedChan();
      trackLabel->setText(part->partName());

      MidiPatch* mp = synti->getPatchInfo(chan->synti(), chan->bank(), chan->program());


      QString tooltip = tr("Part Name: %1\n"
                                "Primary Instrument: %2\n"
                                "Bank: %3\n"
                                "Program: %4\n"
                                "Patch: %5")
                  .arg(part->partName(),
                       part->longName(),
                       QString::number(chan->bank()),
                       QString::number(chan->program()),
                       mp ? mp->name : tr("~no patch~"));

      trackLabel->setToolTip(tooltip);

      QColor bgCol((QRgb)part->color());
      QString colName = bgCol.name();
      int val = bgCol.value();

      QString ss = QString(".QLabel {"
                 "border: 2px solid black;"
                 "background: %1;"
                "color: %2;"
                 "padding: 6px 0px;"
             "}").arg(colName, val > 128 ? "black" : "white");

      trackLabel->setStyleSheet(ss);

      //Update component colors
      qreal h, s, v;
      bgCol.getHsvF(&h, &s, &v);
      QColor brightCol = QColor::fromHsvF(h, s, 1);
      panSlider->setScaleValueColor(brightCol);
      volumeSlider->setHilightColor(brightCol);
      }
Example #19
0
static Part constructPartHierarchyRecursive(vector2DMat& filters, vectori& parents, int level, int self) {

	// find all of the children who have self (current Part) as a parent
	vectori cidx = find(parents, self);
	std::vector<Part> children;
	int ndescendants = 0;
	vector2Df bias;

	// recursive termination criteria:
	// this Part has no children. We are at a leaf node
	if (cidx.size() == 0) return Part(bias, filters[self], self, children, level, ndescendants);

	// otherwise, recursively create child Parts
	for (unsigned int n = 0; n < cidx.size(); ++n) {
		Part child = constructPartHierarchyRecursive(filters, parents, level+1, cidx[n]);
		ndescendants += (child.ndescendants()+1);
		children.push_back(child);
	}
	return Part(bias, filters[self], self, children, level, ndescendants);
}
void Hand_Custom::Part_Collision_Mapping()
{
	std::vector<CollisionInfoStruct*> CollidesList;
	IHand::mAsmInfo->parsePartCollision(CollidesList);
	for (unsigned int i=0; i<CollidesList.size(); i++)
	{
		Part* pt = NULL;
		pt = IHand::getPartFromVector(CollidesList[i]->name);
		if(pt == NULL)
		{
			QString mes = QString("No part named [%1] has been found during Collision Mapping!\n").arg(CollidesList[i]->name.c_str());
			mes.append("This might cause crash. Please fix this error and then try again.");
			QMessageBox::warning(NULL, "Warning", mes);
			break;
		}
		pt->getModelPtr()->SetCollisionMesh();
		pt->setCollisionCategoryBits(CollidesList[i]->CollisionCategory);
		pt->setCollisionCollideBits(CollidesList[i]->CollisionCollides);
	}
}
Example #21
0
KParts::Part *Factory::createPartObject(QWidget *parentWidget,
                                        QObject* parent,
                                        const char* classname,
                                        const QStringList &)
{
    // If classname is "KoDocument", our host is a koffice application
    // otherwise, the host wants us as a simple part, so switch to readonly
    // and single view.
    bool bWantKoDocument = (strcmp(classname, "KoDocument") == 0);

    // parentWidget and widgetName are used by KoDocument for the
    // "readonly+singleView" case.
    Part *part = new Part(parentWidget, parent,
                          !bWantKoDocument);

    if (!bWantKoDocument)
      part->setReadWrite(false);

    return part;
}
void DependencyLabelerParts::BuildSiblingIndices(
    const std::vector<int> &heads) {
  DeleteSiblingIndices();
  index_siblings_.assign(heads.size(),
                         std::vector<std::vector<int> >(0));
  for (int h = 0; h < heads.size(); ++h) {
    index_siblings_[h].assign(siblings_[h].size() + 1,
                              std::vector<int>(0));
  }
  int offset, num_siblings;
  GetOffsetSibling(&offset, &num_siblings);
  for (int r = 0; r < num_siblings; ++r) {
    Part *part = (*this)[offset + r];
    CHECK(part->type() == DEPENDENCYLABELERPART_SIBLING);
    int h = static_cast<DependencyLabelerPartSibling*>(part)->head();
    int m = static_cast<DependencyLabelerPartSibling*>(part)->modifier();
    int i = GetSiblingIndex(h, m);
    index_siblings_[h][i].push_back(offset + r);
  }
}
Example #23
0
Note* searchTieNote(Note* note)
      {
      Note* note2  = 0;
      Chord* chord = note->chord();
      Segment* seg = chord->segment();
      Part* part   = chord->staff()->part();
      int strack   = part->staves()->front()->idx() * VOICES;
      int etrack   = strack + part->staves()->size() * VOICES;

      if (chord->isGraceBefore()) {
            chord = static_cast<Chord*>(chord->parent());
            note2 = chord->findNote(note->pitch());
            return note2;
            }
      QList<Chord*> gna;
      if (chord->getGraceNotesAfter(&gna)) {
            chord = gna[0];
            note2 = chord->findNote(note->pitch());
            return note2;
            }

      while ((seg = seg->next1(Segment::Type::ChordRest))) {
            for (int track = strack; track < etrack; ++track) {
                  Chord* c = static_cast<Chord*>(seg->element(track));
                  if (c == 0 || c->type() != Element::Type::CHORD)
                        continue;
                  int staffIdx = c->staffIdx() + c->staffMove();
                  if (staffIdx != chord->staffIdx() + chord->staffMove())  // cannot happen?
                        continue;
                  for (Note* n : c->notes()) {
                        if (n->pitch() == note->pitch()) {
                              if (note2 == 0 || c->track() == chord->track())
                                    note2 = n;
                              }
                        }
                  }
            if (note2)
                  break;
            }
      return note2;
      }
Example #24
0
static bool set_render_target(const char *pname, const char **args) {
	Part *part = get_part(pname);
	if(part && args[0]) {
		int tnum;

		// check for valid render target specifier (fb, t0, t1, t2, t3)
		if(!strcmp(args[0], "fb")) {
			tnum = (int)RT_FB;
		} else {
			if(args[0][0] != 't' || !isdigit(args[0][1]) || args[0][2] ||
				(tnum = atoi(args[0]+1)) < 0 || tnum > 3) {
				return false;
			}
		}

		info("set_rtarg(%s, %s)", pname, args[0]);
		part->set_target((RenderTarget)tnum);
		return true;
	}
	return false;
}
Example #25
0
	void Puppet::LoadParts(TiXmlElement *element, Entity *intoEntity)
	{
		TiXmlElement *xmlPart = element->FirstChildElement("Part");
		while (xmlPart)
		{
			XMLFileNode xmlFileNode(xmlPart);

			Part *part = new Part();
			part->SetPuppet(this);
			part->Load(&xmlFileNode);
			
			LoadParts(xmlPart, part);

			parts.push_back(part);

			/// TODO...?
			intoEntity->Add(part);

			xmlPart = xmlPart->NextSiblingElement("Part");
		}
	}
Example #26
0
bool Kernel::has_superset( const Part & p ) const
{
  const unsigned ordinal = p.mesh_meta_data_ordinal();

  std::pair<const unsigned *, const unsigned *> 
    part_ord = superset_part_ordinals();

  part_ord.first =
    std::lower_bound( part_ord.first , part_ord.second , ordinal );

  return part_ord.first < part_ord.second && ordinal == *part_ord.first ;
}
Example #27
0
QObject* Factory::create( const char* iface, QWidget* parentWidget, QObject *parent,
                             const QVariantList& args, const QString& keyword )
{
    Q_UNUSED( args );
    Q_UNUSED( keyword );

    // If classname is "KoDocument", our host is a koffice application
    // otherwise, the host wants us as a simple part, so switch to readonly
    // and single view.
    bool bWantKoDocument = ( strcmp( iface, "KoDocument" ) == 0 );

    // parentWidget and widgetName are used by KoDocument for the
    // "readonly+singleView" case.
    Part *part = new Part(parentWidget, parent,
                          !bWantKoDocument);

    if (!bWantKoDocument)
      part->setReadWrite(false);

    return part;
}
void TopologicalMetaData::throw_required( const Part & part ,
                                          const char * required_by )
{
  static const char method[] = "stk::mesh::get_cell_topology" ;

  std::ostringstream msg ;

  msg << required_by << " Failed to obtain cell topology from "
      << method << "( Part[" << part.name() << "] );" ;

  throw std::runtime_error( msg.str() );
}
Example #29
0
void DependencyParts::BuildIndices(int sentence_length, bool labeled) {
  DeleteIndices();
  index_.resize(sentence_length);
  for (int h = 0; h < sentence_length; ++h) {
    index_[h].resize(sentence_length);
    for (int m = 0; m < sentence_length; ++m) {
      index_[h][m] = -1;
    }
  }

  int offset, num_basic_parts;
  GetOffsetArc(&offset, &num_basic_parts);
  for (int r = 0; r < num_basic_parts; ++r) {
    Part *part = (*this)[offset + r];
    CHECK(part->type() == DEPENDENCYPART_ARC);
    int h = static_cast<DependencyPartArc*>(part)->head();
    int m = static_cast<DependencyPartArc*>(part)->modifier();
    index_[h][m] = offset + r;
  }

  if (labeled) {
    index_labeled_.resize(sentence_length);
    for (int h = 0; h < sentence_length; ++h) {
      index_labeled_[h].resize(sentence_length);
      for (int m = 0; m < sentence_length; ++m) {
        index_labeled_[h][m].clear();
      }
    }

    int offset, num_labeled_arcs;
    GetOffsetLabeledArc(&offset, &num_labeled_arcs);
    for (int r = 0; r < num_labeled_arcs; ++r) {
      Part *part = (*this)[offset + r];
      CHECK(part->type() == DEPENDENCYPART_LABELEDARC);
      int h = static_cast<DependencyPartLabeledArc*>(part)->head();
      int m = static_cast<DependencyPartLabeledArc*>(part)->modifier();
      index_labeled_[h][m].push_back(offset + r);
    }
  }
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void QSRSnippetWidget::setRenderMode(DrawableGeo::RenderMode mode)
{
    m_lastSetRenderMode = mode;

    Collection<Part> allParts;

    RenderSequence* renderSeq = m_snippet->renderSequence();
    CVF_ASSERT(renderSeq);

    int numPasses = renderSeq->renderingCount();

    int i;
    for (i = 0; i < numPasses; i++)
    {
        Rendering* rendering = renderSeq->rendering(i);
        CVF_ASSERT(rendering);

        Scene* scene = rendering->scene();
        CVF_ASSERT(scene);

        scene->allParts(&allParts);
    }

    size_t numParts = allParts.size();
    size_t partIdx;
    for (partIdx = 0; partIdx < numParts; partIdx++)
    {
        Part* part = allParts.at(partIdx);

        cvf::uint lod;
		for (lod = 0; lod < cvf::Part::MAX_NUM_LOD_LEVELS; lod++)
        {
            DrawableGeo* drawableGeo = dynamic_cast<DrawableGeo*>(part->drawable(lod));
            if (drawableGeo)
            {
                drawableGeo->setRenderMode(m_lastSetRenderMode);
            }
        }
    }
}