创建一个多边型立方体:Create > Polygons Primitives > Cube

创建多边型工具: polygons>create polygon tools 选中此工具,在视图中依次点击四次完成后回
车创建一个四边型面。

扩展多边型命令:选中刚才创建的四边型,选择,polygons>Append To Polygon Tool点击四边型中
任何一个边进括展边的操作。

多边型合并:两个多边型物体合并为一个物体 polygon>combine

多边型布尔运算:多边型建模工具提供了三种布尔运算方式,
polygon>booleans>union,difference,intersection合集,交集,差集。

多边型镜向:选择任意模型然后选polygon>mirror进行镜向,镜向同时可以指定是否合并边。

光滑模型:选择任意多边型模然后选择,polygons>smooth进行光滑模型,可指定光滑等级。

光滑代理方式:选择任意模型,然后选择,polygons>Smooth Proxy或使用快捷键Ctrl+`。

平均点命令:选中模型或其中任意的顶点,然后选择polygons>Average Vertices进行平滑模型。

三边型转换命令:选中任意模型,然后选择polygons>Triangulate可将四边型模型转换为三边型模型。

四边型转换命令:选中任意模型,然后选择polygons>Quadrangulate 可将三边型模型转换为四边型模型。

多边型工具设定:keep faces together 这项工具用于设定挤出的边是否合并,此项设定上非常重要。

细分表面:在多边型表面方式下选择任意面,然后选择edit polygons>Subdivise

切线命令:选中多边型模然后选择edit polygons>split polygon tool 在模型边上任意点击回车完成切线。

posted @ 2010-02-21 21:33 邹敏 阅读(780) | 评论 (0)编辑 收藏

      回想起在微软做实习生时的情景。一年之前是自己做不好东西,让徐老师痛心,在受到徐老师批评时心里很是不服气,总认为徐老师的指导有问题。而自己则在固执,偏执,愚笨,自以为是与自负的心态中继续自己的烂程序。事情的结果自然是东西始终没有成型,自己伤心,更让徐老师痛心。
      时隔一年,现在的老师让我带着一个刚来的师弟做一个东西。很不幸,这个师弟完美的复制了一年前的我,缺乏锻炼与思维的培养,而且有些自以为是。长久以来,我都是选择合作者,所以所作之事,都算顺心。但是这次,很糟糕。有时候自己控制不住情绪,发几句火,结果实验室火药味十足。我在生气为什么他的东西有问题,而他在生气我为什么冲着他发火。
        自己心里面很是窝火。。。。。
        当年所作事情的比现在的要重要的多,徐老师应该窝了很大的火吧。 真是对不住了,徐老师!

posted @ 2010-02-11 13:56 邹敏 阅读(440) | 评论 (2)编辑 收藏

 

#include<string>
using namespace std;
string ReadFile(string fileName)
{
   
string all_contents;
   FILE 
*file=fopen(fileName.c_str(),"r");
   
char c=fgetc(file);
   
while (c!=EOF)
   {
    all_contents
+=c;
    c
=fgetc(file);
   }
    fclose(file);
    
return all_contents;

posted @ 2010-02-11 12:29 邹敏 阅读(822) | 评论 (0)编辑 收藏

单例模式,举例如下:  
  class   Singleton  
  {  
      //   Fields  
        private   static   Singleton   instance;  
      //   Constructor  
        protected   Singleton()   {}  
      //   Methods  
        public   static   Singleton   Instance()  
      {  
            if(   instance   ==   null   )  
              instance   =   new   Singleton();  
          return   instance;  
      }   
 

posted @ 2010-02-09 14:24 邹敏 阅读(117) | 评论 (0)编辑 收藏

要在case语句中声明变量,要用{}把case块包起来
case 1:
   {
int a=0;
break;
  }

case 2:
{
int a=2;
break;
}

posted @ 2010-02-07 22:25 邹敏 阅读(661) | 评论 (2)编辑 收藏

C++中文件相互包含是一件非常麻烦的事情。因此在写嵌套类的时候最好把两个类都写在相同的.h文件和.cpp文件中

posted @ 2010-01-29 23:29 邹敏 阅读(279) | 评论 (0)编辑 收藏

  1 import javax.swing.*;
  2 import javax.swing.border.EmptyBorder;
  3 import java.awt.*;
  4 import java.awt.event.*;
  5 import java.util.*;
  6 
  7 
  8 /**
  9  * Title:        Login Panel
 10  * Description:  A simple yet complete login/logout panel with user callbacks
 11  *               for approving login attempts and getting notification of logouts.
 12  * Copyright:    Copyright (c) 2004
 13  * Company:      Superliminal Software
 14  * @author Melinda Green
 15  * @version 1.0
 16  */
 17 
 18 public class LoginPanel extends JPanel {
 19     public final static String
 20         LOG_IN  = "Login",
 21         LOG_OUT = "Logout";
 22     protected JButton logButt;
 23     public JButton getLogButton() { return logButt; }
 24     private final static int DEFAULT_PSWD_CHARS = 10;
 25     private JTextField nameField = new JTextField(DEFAULT_PSWD_CHARS);
 26     public String getUserName() { return nameField.getText(); }
 27 
 28     /**
 29      * override this method to return true if approved, false otherwise.
 30      * default is true.
 31      */
 32     public boolean approveLogin(String uname, String pswd) {
 33         return true;
 34     }
 35 
 36     /**
 37      * override this method to learn about logout events.
 38      */
 39     public void loggedOut(String uname) {
 40     }
 41 
 42     public LoginPanel() {
 43         this(false);
 44     }
 45 
 46     public LoginPanel(final boolean clearPasswords) {
 47         this(clearPasswords, truenullnull);
 48     }
 49 
 50     /**
 51      * @param clearPasswords if true, clears password field on successful login.
 52      * @param initial_user optional default text to load into the 'user' type-in.
 53      * @param initial_password optional default text to load into the 'password' type-in.
 54      */
 55     public LoginPanel(final boolean clearPasswords, final boolean displayFailures, String initial_user, String initial_password) {
 56         final JPasswordField pswdField = new JPasswordField(DEFAULT_PSWD_CHARS);
 57         logButt = new JButton(LOG_IN);
 58         KeyListener quickLogin = new KeyAdapter() {
 59             public void keyTyped(KeyEvent ke) {
 60                 if(ke.getKeyChar() == KeyEvent.VK_ENTER) {
 61                     logButt.doClick();
 62                     logButt.requestFocus();
 63                 }
 64             }
 65         };
 66         nameField.setText(initial_user);
 67         pswdField.setText(initial_password);
 68         logButt.setName(LOG_IN);
 69         nameField.addKeyListener(quickLogin);
 70         pswdField.addKeyListener(quickLogin);
 71         // create the grid
 72         JPanel grid = new JPanel(new GridLayout(22));
 73         grid.setBackground(new Color(255,255,255));
 74         grid.add(new JLabel("User Name"));
 75         grid.add(nameField);
 76         grid.add(new JLabel("Password"));
 77         grid.add(pswdField);
 78 
 79         // create login button row
 80         JPanel row = new JPanel();
 81         row.setBorder(new EmptyBorder(5050));
 82         row.setOpaque(false);
 83         row.setLayout(new BoxLayout(row, BoxLayout.X_AXIS));
 84         row.add(logButt);
 85         logButt.setBackground(new Color(220,220,220));
 86 
 87         logButt.addActionListener(new ActionListener() {
 88             public void actionPerformed(ActionEvent ae) {
 89                 if(logButt.getText().equals(LOG_IN)) {
 90                     // seek login approval from derived class
 91                     if(approveLogin(nameField.getText(), new String(pswdField.getPassword()))) {
 92                         // note: must set logout text *before* clearing password
 93                         // otherwise component dependancy handler will disable the
 94                         // login button w/out password text before later setting logout text
 95                         // this closes bug #2336
 96                         logButt.setText(LOG_OUT);
 97                         if(clearPasswords)
 98                             pswdField.setText(null);
 99                         nameField.setEnabled(false);
100                         pswdField.setEnabled(false);
101                         fireLoginEvent(nameField.getText(), true);
102                     }
103                     else
104                         if(displayFailures)
105                             JOptionPane.showMessageDialog(LoginPanel.this"Login Denied""Login Error", JOptionPane.ERROR_MESSAGE);
106                 }
107                 else {
108                     logButt.setText(LOG_IN);
109                     loggedOut(nameField.getText());
110                     nameField.setEnabled(true);
111                     pswdField.setEnabled(true);
112                     fireLoginEvent(nameField.getText(), false);
113                 }
114             }
115         });
116 
117         // implement component dependancies
118        // new ComponentDependencyHandler(nameField, pswdField) {
119          //   public void dependencyNotification() {
120            //     String
121              //       logtext = logButt.getText(),
122                //     nametext = nameField.getText(),
123                  //   pswdtext = String.copyValueOf(pswdField.getPassword());
124                 //boolean newstate = logtext.equalsIgnoreCase(LOG_OUT) ||
125                   //  (nameField.getText() != null && nametext.length() > 0 // has login text?
126                  //    && pswdtext.length() > 0);  // has password text?
127                 //logButt.setEnabled(newstate);
128            // }
129         //};
130 
131         // construct final layout
132         setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
133         add(grid);
134         add(row);
135     }
136 
137     public interface LoginListener {
138         void loggedIn(String uname);
139         void loggedOut(String uname);
140     }
141     public static class LoginAdapter implements LoginListener {
142         public void loggedIn(String uname){}
143         public void loggedOut(String uname){}
144     }
145     private Vector loginListeners = new Vector();
146     public void addLoginListener(LoginListener ll) { loginListeners.add(ll); }
147     public void removeLoginListener(LoginListener ll) { loginListeners.remove(ll); }
148     protected void fireLoginEvent(String uname, boolean in) {
149         for(Enumeration e=loginListeners.elements(); e.hasMoreElements(); ) {
150             LoginListener ll = (LoginListener)e.nextElement();
151             if(in)
152                 ll.loggedIn(uname);
153             else
154                 ll.loggedOut(uname);
155         }
156     }
157 
158     /**
159      * simple example test program for LoginPanel class
160      */
161     public static void main(String[] args) {
162         final String NOT_LOGGED_IN = "LoginPanel Test - Currently Logged Out";
163         final JFrame frame = new JFrame(NOT_LOGGED_IN);
164         frame.getContentPane().add(new LoginPanel() {
165             public boolean approveLogin(String uname, String pswd) {
166                 // this is where to make the server call to approve or reject login attempt
167                 frame.setTitle("LoginPanel Test - Currently logged in as " + uname);
168                 return true;
169             }
170             public void loggedOut(String uname) {
171                 frame.setTitle(NOT_LOGGED_IN);
172             }
173         });
174         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
175         frame.pack();
176         frame.setSize(500, frame.getHeight());
177         frame.setVisible(true);
178     }
179 }
180 
181 

posted @ 2008-12-11 09:44 邹敏 阅读(1426) | 评论 (0)编辑 收藏

C/C++中fseek函数最多能够从起始位置偏移32位,也就是4G如果有一个10G的文件应当如下来做:
方法一:用Windows API创建大文件。
Windows API提供了创建大文件的函数,CreateFile, ReadFile,和WriteFile.具体的用法可以参考MSN.他的寻址范围理论上讲可达2^64。可以用__int64类型数据寻址。
 1 __int64 DataBase::myFileSeek(HANDLE hf, __int64 distance, DWORD MoveMethod)
 2 {
 3      LARGE_INTEGER li;
 4    li.QuadPart = distance;
 5 
 6    li.LowPart = SetFilePointer (hf, 
 7                                 li.LowPart, 
 8                                 &li.HighPart, 
 9                                 MoveMethod);
10 
11    if (li.LowPart == INVALID_SET_FILE_POINTER && GetLastError() 
12        != NO_ERROR)
13    {
14       li.QuadPart = -1;
15    }
16    return li.QuadPart;
17 }
方法二:把大文件拆成不超过2G的小文件来逐个处理。那么寻址方式为
__int64 Address=FileNum*2G+Address%2G.
文件索引为:Address/2G.文件内偏移为Address%2G.
1

posted @ 2008-11-19 22:23 邹敏 阅读(547) | 评论 (0)编辑 收藏

malloc 失败的可能原因是前面存在内存超界访问。比如说前面有double *a=(double*)malloc(10*sizeof(double)); a[10]=10;那么再用malloc时就可能会出问题。
在我的代码中a[11]=11;之后使用malloc仍不会出问题,但是a[20]=20;再使用malloc 就出问题了。
解决此类问题方法之一是在程序调试阶段判断是否存在访问超界的情况,在赋值或者访问数组前先判断下标的大小是否超出了数组分配的实际大小。

posted @ 2008-11-18 10:28 邹敏 阅读(4921) | 评论 (1)编辑 收藏

假设有char a[2];
如要把a转换为int值。应是如下写法int b=*(int *)a;
即,先把指针a 转换为一个int指针,然后再此基础上取值。
但是另一种写法 int b=(int)(*a);是不对的,*a 取a的内存单元内容,因为现在a是char指针,所以只会取a[1]中内容,最大为255. 这里要说明的是,在把char或byte数组转换为其他类型的值时,要先把数组指针的类型变为其他数据类型的指针。然后再取值。

posted @ 2008-10-23 14:08 邹敏 阅读(6446) | 评论 (0)编辑 收藏

仅列出标题
共2页: 1 2