Exemple #1
0
int main() {
	Surface* surface = new Surface(70, 60, ' ');

	drawBody(surface);
	drawCockpit(surface);

	drawWing(surface, true);
	drawWing(surface, false);

	drawSeats(surface);

	drawTail(surface);

	std::cout << surface->str() << std::endl;
}
void TIGLViewerWindow::connectConfiguration()
{
    if (!cpacsConfiguration) {
        return;
    }
    
    // CPACS Wing Actions
    connect(drawWingProfilesAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawWingProfiles()));
    connect(drawWingOverlayCPACSProfilePointsAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawWingOverlayProfilePoints()));
    connect(drawWingGuideCurvesAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawWingGuideCurves()));
    connect(drawWingsAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawWing()));
    connect(drawWingTriangulationAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawWingTriangulation()));
    connect(drawWingSamplePointsAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawWingSamplePoints()));
    connect(drawFusedWingAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFusedWing()));
    connect(drawWingComponentSegmentAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawWingComponentSegment()));
    connect(drawWingCSPointAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawWingComponentSegmentPoints()));
    connect(drawWingShellAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawWingShells()));


    // CPACS Aircraft Actions
    connect(showAllWingsAndFuselagesAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawAllFuselagesAndWings()));
    connect(showAllWingsAndFuselagesSurfacePointsAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawAllFuselagesAndWingsSurfacePoints()));
    connect(drawFusedAircraftAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFusedAircraft()));
    connect(drawIntersectionAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawIntersectionLine()));
    connect(showFusedAirplaneTriangulation, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFusedAircraftTriangulation()));
    connect(drawFarFieldAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFarField()));

    // CPACS Fuselage Actions
    connect(drawFuselageProfilesAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFuselageProfiles()));
    connect(drawFuselageAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFuselage()));
    connect(drawFuselageTriangulationAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFuselageTriangulation()));
    connect(drawFuselageSamplePointsAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFuselageSamplePoints()));
    connect(drawFuselageSamplePointsAngleAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFuselageSamplePointsAngle()));
    connect(drawFusedFuselageAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFusedFuselage()));
    connect(drawFuselageGuideCurvesAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(drawFuselageGuideCurves()));

    // Export functions
    connect(tiglExportFusedIgesAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportFusedAsIges()));
    connect(tiglExportIgesAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportAsIges()));
    connect(tiglExportFusedStepAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportAsStepFused()));
    connect(tiglExportStepAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportAsStep()));
    connect(tiglExportMeshedWingSTL, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportMeshedWingSTL()));
    connect(tiglExportMeshedFuselageSTL, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportMeshedFuselageSTL()));
    connect(tiglExportMeshedWingVTK, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportMeshedWingVTK()));
    connect(tiglExportMeshedWingVTKsimple, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportMeshedWingVTKsimple()));
    connect(tiglExportMeshedFuselageVTK, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportMeshedFuselageVTK()));
    connect(tiglExportMeshedConfigVTK, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportMeshedConfigVTK()));
    connect(tiglExportMeshedConfigVTKNoFuse, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportMeshedConfigVTKNoFuse()));
    connect(tiglExportMeshedFuselageVTKsimple, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportMeshedFuselageVTKsimple()));
    connect(tiglExportWingColladaAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportWingCollada()));
    connect(tiglExportFuselageColladaAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportFuselageCollada()));
    connect(tiglExportConfigurationColladaAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportConfigCollada()));
    connect(tiglExportFuselageBRepAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportFuselageBRep()));
    connect(tiglExportWingBRepAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportWingBRep()));
    connect(tiglExportFusedConfigBRep, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportFusedConfigBRep()));
    connect(tiglExportWingCurvesBRepAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportWingCurvesBRep()));
    connect(tiglExportFuselageCurvesBRepAction, SIGNAL(triggered()), cpacsConfiguration, SLOT(exportFuselageCurvesBRep()));
    
    connect(cpacsConfiguration, SIGNAL(documentUpdated(TiglCPACSConfigurationHandle)), 
             this, SLOT(updateMenus()) );
}
Exemple #3
0
void Robot::draw() const {
    
    // Retrieve the current (interpolated) pose of the robot.
    Pose pose = getPose();
    
    // You can set the robot to be whatever color you like.
    // By default it is white.
    glPushMatrix();
    glMatrixMode(GL_MODELVIEW);
    //BODY
    glColor4d(1, 1, 1, 1);
    glTranslatef(pose.x_, pose.y_,pose.z_);
    glRotatef(pose.angles_[BODY_ANGLE], 0, 0, 1);
    drawCuboid(BODY_X,BODY_LEN,BODY_Z);
    //HEAD
    glPushMatrix();
    glTranslatef(0,BODY_LEN/2,0);
    glRotatef(pose.angles_[HEAD_ANGLE], 0, 0, 1);
    glTranslatef(0,.3,0);
    drawCuboid(.6,.6,.6);
    glPopMatrix();
    // ARMS!!
    //Right
    glPushMatrix();
    glTranslatef(0, BODY_LEN/2.0, BODY_Z/2.0 + UARM_WIDTH/2.0); //Move to shoulder joint from center of body
    drawArm(pose, RIGHT_SHOULDER, RIGHT_ELBOW);
    glPopMatrix();
    //Left
    glPushMatrix();
    glTranslatef(0, BODY_LEN/2.0, - (BODY_Z/2.0 + UARM_WIDTH/2.0)); //Move to shoulder joint from center of body
    drawArm(pose, LEFT_SHOULDER, LEFT_ELBOW);
    glPopMatrix();
    //LEGS
    //RIGHT
    glPushMatrix();
    glTranslatef(0, -1, .25);
    drawLeg(pose, RIGHT_HIP, RIGHT_KNEE, RIGHT_ANKLE);
    glPopMatrix();
    //LEFT
    glPushMatrix();
    glTranslatef(0, -1, -.25);
    drawLeg(pose, LEFT_HIP, LEFT_KNEE, LEFT_ANKLE);
    glPopMatrix();
    //WINGS
    //RIGHT
    glPushMatrix();
    glTranslatef(-BODY_X/2.0,BODY_LEN/2.0 -.2,BODY_Z/2.0 - .2);
    drawWing(pose, RIGHT_WING_MID_Y, RIGHT_WING_Y, RIGHT_WING_Z);
    glPopMatrix();

    //LEFT
    glPushMatrix();
    glTranslatef(-BODY_X/2.0,BODY_LEN/2.0 -.2, -BODY_Z/2.0 + .2);
    drawWing(pose, LEFT_WING_MID_Y, LEFT_WING_Y, LEFT_WING_Z);
    glPopMatrix();



    //Body matrix
    glPopMatrix();
}