2014년 7월 31일 목요일

Android에서 키보드 사라지게 하기


다음처럼부르면 됨

DDUtil.setupUI(MainActivity.this, findViewById(R.id.parent));


다음처럼 간단히
public class DDUtil {
    public static void setupUI(final Activity activity, View view) {
        //Set up touch listener for non-text box views to hide keyboard.
        if(!(view instanceof EditText)) {
            view.setOnTouchListener(new View.OnTouchListener() {
                public boolean onTouch(View v, MotionEvent event) {
                    hideSoftKeyboard(activity);//MainActivity.this
                    return false;
                }
            });
        }
        //If a layout container, iterate over children and seed recursion.
        if (view instanceof ViewGroup) {
            for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {
                View innerView = ((ViewGroup) view).getChildAt(i);
                setupUI(activity, innerView);
            }
        }
    }
    public static void hideSoftKeyboard(Activity activity)
    {
        InputMethodManager inputMethodManager = (InputMethodManager)  activity.getSystemService(Activity.INPUT_METHOD_SERVICE);
        inputMethodManager.hideSoftInputFromWindow(activity.getCurrentFocus().getWindowToken(), 0);
    }
}



참고 :
http://stackoverflow.com/questions/4165414/how-to-hide-soft-keyboard-on-android-after-clicking-outside-edittext


2014년 7월 28일 월요일

Maya: parenting an object


parent 붙일child  parent노드


풀기 : unparent given object(s) -- parent to world
parent -w instrument_asm_10mm;

엮기
parent 붙일child  parent노드
parent coupler:IGES_Model_Data active_arm_v1_tmp:transform1094;


아래는 공식 사이트에서


// Move the circle under group2.
// Note that the circle remains where it is.
parent circle1 group2;


2014년 7월 9일 수요일

CMAttitudeReferenceFrame

Enum constants for indicating the reference frames from which all attitude samples are referenced.


typedef enum {
     CMAttitudeReferenceFrameXArbitraryZVertical = 1 << 0,
     CMAttitudeReferenceFrameXArbitraryCorrectedZVertical = 1 << 1,
     CMAttitudeReferenceFrameXMagneticNorthZVertical = 1 << 2,
     CMAttitudeReferenceFrameXTrueNorthZVertical = 1 << 3
} CMAttitudeReferenceFrame


CMAttitudeReferenceFrameXArbitraryZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points in an arbitrary direction in the horizontal plane.

CMAttitudeReferenceFrameXArbitraryCorrectedZVertica
: Describes the same reference frame as CMAttitudeReferenceFrameXArbitraryZVertical except that the magnetometer, when available and calibrated, is used to improve long-term yaw accuracy. Using this constant instead of CMAttitudeReferenceFrameXArbitraryZVertical results in increased CPU usage.

CMAttitudeReferenceFrameXMagneticNorthZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points toward magnetic north. Note that using this reference frame may require device movement to calibrate the magnetometer.

CMAttitudeReferenceFrameXTrueNorthZVertical
: Describes a reference frame in which the Z axis is vertical and the X axis points toward true north. Note that using this reference frame may require device movement to calibrate the magnetometer. It also requires the location to be available in order to calculate the difference between magnetic and true north.

all available in iOS 5.0 and later.


source : Apple dev page.

2014년 7월 6일 일요일

atan2

The atan2 function takes into account the signs of both vector components, and places the angle in the correct quadrant.



The following expression derived from the tangent half-angle formula can also be used to define atan2.




from http://en.wikipedia.org/wiki/Atan2

2014년 7월 1일 화요일

CWnd::~CWnd


Warning: calling DestroyWindow in CWnd::~CWnd; OnDestroy or PostNcDestroy in derived class will not be called.


Callback code

/* Return code for callbacks, determines whether the operation is finished
   and will unscheduled, or whether it will continue running. */

typedef unsigned int HDCallbackCode;
#define HD_CALLBACK_DONE     0
#define HD_CALLBACK_CONTINUE 1

from
\OpenHaptics\Academic\3.2\include\HD\hdScheduler.h