+ handle case if each face has its own color and a face has no triangles
+ do not write out fields of SoFCUnifiedSelection node + show wait cursor when importing parts git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5406 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
parent
3ced7cba97
commit
197f875375
|
@ -169,6 +169,20 @@ const char* SoFCUnifiedSelection::getFileFormatName(void) const
|
|||
return "Separator";
|
||||
}
|
||||
|
||||
void SoFCUnifiedSelection::write(SoWriteAction * action)
|
||||
{
|
||||
SoOutput * out = action->getOutput();
|
||||
if (out->getStage() == SoOutput::WRITE) {
|
||||
// Do not write out the fields of this class
|
||||
if (this->writeHeader(out, TRUE, FALSE)) return;
|
||||
SoGroup::doAction((SoAction *)action);
|
||||
this->writeFooter(out);
|
||||
}
|
||||
else {
|
||||
inherited::write(action);
|
||||
}
|
||||
}
|
||||
|
||||
int SoFCUnifiedSelection::getPriority(const SoPickedPoint* p)
|
||||
{
|
||||
const SoDetail* detail = p->getDetail();
|
||||
|
|
|
@ -72,6 +72,7 @@ public:
|
|||
};
|
||||
|
||||
const char* getFileFormatName(void) const;
|
||||
void write(SoWriteAction * action);
|
||||
|
||||
SoSFColor colorHighlight;
|
||||
SoSFColor colorSelection;
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include <Gui/Selection.h>
|
||||
#include <Gui/View3DInventor.h>
|
||||
#include <Gui/View3DInventorViewer.h>
|
||||
#include <Gui/WaitCursor.h>
|
||||
|
||||
#include "../App/PartFeature.h"
|
||||
#include "DlgPartImportStepImp.h"
|
||||
|
@ -452,6 +453,7 @@ void CmdPartImport::activated(int iMsg)
|
|||
|
||||
QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(), filter.join(QLatin1String(";;")));
|
||||
if (!fn.isEmpty()) {
|
||||
Gui::WaitCursor wc;
|
||||
App::Document* pDoc = getDocument();
|
||||
if (!pDoc) return; // no document
|
||||
openCommand("Import Part");
|
||||
|
|
|
@ -391,6 +391,14 @@ void SoBrepFaceSet::renderShape(const SoGLCoordinateElement * const vertexlist,
|
|||
int matnr = 0;
|
||||
int trinr = 0;
|
||||
pi = piptr < piendptr ? *piptr++ : -1;
|
||||
while (pi == 0) {
|
||||
// It may happen that a part has no triangles
|
||||
pi = piptr < piendptr ? *piptr++ : -1;
|
||||
if (mbind == PER_PART)
|
||||
matnr++;
|
||||
else if (mbind == PER_PART_INDEXED)
|
||||
matindices++;
|
||||
}
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
while (viptr + 2 < viendptr) {
|
||||
|
@ -503,6 +511,14 @@ void SoBrepFaceSet::renderShape(const SoGLCoordinateElement * const vertexlist,
|
|||
trinr++;
|
||||
if (pi == trinr) {
|
||||
pi = piptr < piendptr ? *piptr++ : -1;
|
||||
while (pi == 0) {
|
||||
// It may happen that a part has no triangles
|
||||
pi = piptr < piendptr ? *piptr++ : -1;
|
||||
if (mbind == PER_PART)
|
||||
matnr++;
|
||||
else if (mbind == PER_PART_INDEXED)
|
||||
matindices++;
|
||||
}
|
||||
trinr = 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user