Bonjour,
Je développe une application avec la librairie open source qcadlib pour une application de gestion de production. J'arrive à faire ce dont j'ai besoin mais j'aurais encore besoin d'obtenir les dimensions générales (hauteur, largeur) des pièces en millimètre. Comment puis-je faire cela. Toutes les autres dimensions ne m'intéresses pas, uniquement les deux principales.
Merci pour l'aide.
In english:
I am developping an application with the open source library qcadlib. I can do what I need but I need to obtain the main dimensions (width, height). How is it possible to do that? The others dimension is not needed.
Thank you for you help
Obtenir les dimensions générales
Forum rules
Indiquez toujours votre système d'exploitation et votre version de QCAD.
Joignez les fichiers de dessin et les captures d'écran.
Postez une question par sujet.
Indiquez toujours votre système d'exploitation et votre version de QCAD.
Joignez les fichiers de dessin et les captures d'écran.
Postez une question par sujet.
pour ceux que ça intéresse, j'ai fait cela comme cela:
graphic est un RS_Graphic
Code: Select all
RS_LayerList *layerList = graphic->getLayerList ();
for(int i=0; i < graphic->countLayers(); i++)
{
if( graphic->countLayerEntities ( layerList->at(i) ) > 0)
{
double minX = graphic->entityAt(0)->getMin().x;
double minY = graphic->entityAt(0)->getMin().y;
double maxX = graphic->entityAt(0)->getMax().x;
double maxY = graphic->entityAt(0)->getMax().y;
for(int j=0; j< graphic->countLayerEntities ( layerList->at(i) ); j++)
{
RS_Entity *entity = graphic->entityAt(j);
if(entity)
{
RS_Vector min = entity->getMin();
RS_Vector max = entity->getMax();
if(min.x < minX) minX = min.x;
if(min.y < minY) minY = min.y;
if(max.x > maxX) maxX = max.x;
if(max.y > maxY) maxY = max.y;
}
}
qDebug() << (maxX - minX) << " x " << (maxY - minY);
}
}