Integration of OCCT 6.5.0 from SVN

This commit is contained in:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

View File

@@ -0,0 +1,102 @@
//Title: Viewer3D Sample
//Version:
//Copyright: Copyright (c) 1999
//Author: User Interface group
//Company: Matra Datavision
//Description:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import CASCADESamplesJni.*;
import SampleViewer3DJni.*;
import jcas.Standard_Real;
public class ShadingModelDlg extends JDialog
implements ActionListener
{
private V3d_View myView;
//=======================================================================//
// Construction
//=======================================================================//
public ShadingModelDlg(Frame frame, V3d_View aView)
{
super(frame, "ShadingModel", false);
myView = aView;
try
{
jbInit();
pack();
}
catch(Exception ex)
{
ex.printStackTrace();
}
}
void jbInit() throws Exception
{
getContentPane().setLayout(new GridLayout(0, 1));
getContentPane().setBounds(10, 10, 10, 10);
JButton button;
button = new JButton("COLOR");
button.addActionListener(this);
button.setActionCommand("Color");
getContentPane().add(button);
button = new JButton("FLAT");
button.addActionListener(this);
button.setActionCommand("Flat");
getContentPane().add(button);
button = new JButton("GOURAUD");
button.addActionListener(this);
button.setActionCommand("Gouraud");
getContentPane().add(button);
}
//=======================================================================//
// Commands
//=======================================================================//
private void onShadingModelColor()
{
SampleViewer3DPackage.ChangeShadingModel(myView, V3d_TypeOfShadingModel.V3d_COLOR);
}
//=======================================================================//
private void onShadingModelFlat()
{
SampleViewer3DPackage.ChangeShadingModel(myView, V3d_TypeOfShadingModel.V3d_FLAT);
}
//=======================================================================//
private void onShadingModelGouraud()
{
SampleViewer3DPackage.ChangeShadingModel(myView, V3d_TypeOfShadingModel.V3d_GOURAUD);
}
//=======================================================================//
// Action listener interface
//=======================================================================//
public void actionPerformed(ActionEvent event)
{
String nameAction = event.getActionCommand();
if (nameAction.equals("Color"))
onShadingModelColor();
else if (nameAction.equals("Flat"))
onShadingModelFlat();
else if (nameAction.equals("Gouraud"))
onShadingModelGouraud();
}
}