本文整理汇总了Java中com.panoramagl.utils.PLLog类的典型用法代码示例。如果您正苦于以下问题:Java PLLog类的具体用法?Java PLLog怎么用?Java PLLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PLLog类属于com.panoramagl.utils包,在下文中一共展示了PLLog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
@Override
public boolean render(GL10 gl, PLIRenderer renderer)
{
try
{
if(mIsVisible && mIsValid)
{
mIsRendering = true;
this.beginRender(gl, renderer);
this.internalRender(gl, renderer);
this.endRender(gl, renderer);
mIsRendering = false;
return true;
}
}
catch(Throwable e)
{
mIsRendering = false;
PLLog.error("PLRenderableElementBase::render", e);
}
return false;
}
示例2: interpret
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**interpret methods*/
@Override
public boolean interpret(PLIView view, String text)
{
mView = view;
try
{
PLCommandTokenizer tokenizer = new PLCommandTokenizer();
tokenizer.tokenize(text);
this.parseCommands(tokenizer.getTokens(), 0);
}
catch(Throwable e)
{
PLLog.error("PLCommandInterpreter::interpret", e);
return false;
}
finally
{
mView = null;
}
return true;
}
示例3: run
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**Runnable methods*/
@Override
public void run()
{
try
{
if(mTokenInfo.getName().equals("load"))
{
PLITokenInfo transitionTokenInfo = (mTokenInfo.hasValue(2) ? mTokenInfo.getTokenInfo(2) : null);
if(transitionTokenInfo != null && transitionTokenInfo.getName().equals("null"))
transitionTokenInfo = null;
mView.load(new PLJSONLoader(mTokenInfo.getString(0)), mTokenInfo.hasValue(1) ? mTokenInfo.getBoolean(1) : false, transitionTokenInfo != null ? new PLTransitionBlend(transitionTokenInfo.getFloat(0), transitionTokenInfo.hasValue(1) ? transitionTokenInfo.getFloat(1) : -1.0f) : null, mTokenInfo.hasValue(3) ? mTokenInfo.getFloat(3) : PLConstants.kFloatUndefinedValue, mTokenInfo.hasValue(4) ? mTokenInfo.getFloat(4) : PLConstants.kFloatUndefinedValue);
}
}
catch(Throwable e)
{
PLLog.error("PLCommandRunnable::run", e);
}
}
示例4: createFrameBuffer
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**buffer methods*/
protected void createFrameBuffer(GL11ExtensionPack gl11ep)
{
if(mContextSupportsFrameBufferObject)
{
gl11ep.glGenFramebuffersOES(1, mDefaultFramebuffer, 0);
if(mDefaultFramebuffer[0] <= 0)
PLLog.error("PLRenderer::createFrameBuffer", "Invalid framebuffer id returned!");
gl11ep.glGenRenderbuffersOES(1, mColorRenderbuffer, 0);
if(mColorRenderbuffer[0] <= 0)
PLLog.error("PLRenderer::createFrameBuffer", "Invalid renderbuffer id returned!");
gl11ep.glBindFramebufferOES(GL11ExtensionPack.GL_FRAMEBUFFER_OES, mDefaultFramebuffer[0]);
gl11ep.glBindRenderbufferOES(GL11ExtensionPack.GL_RENDERBUFFER_OES, mColorRenderbuffer[0]);
}
}
示例5: onSurfaceCreated
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**android: GLSurfaceView.Renderer methods*/
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config)
{
try
{
mIsGLContextCreated = false;
mGLWrapper = (PLOpenGLSupport.isHigherThanOpenGL1(gl) ? new GLWrapper(gl, mView.getGLSurfaceView()) : new MatrixTrackingGL(gl, mView.getGLSurfaceView()));
//mContextSupportsFrameBufferObject = PLOpenGLSupport.checkIfContextSupportsFrameBufferObject(gl);
this.start();
if(mListener != null)
mListener.rendererCreated(this);
}
catch(Throwable e)
{
PLLog.error("PLRenderer::onSurfaceCreated", e);
}
}
示例6: requestJSON
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**json methods*/
protected void requestJSON(PLFileDownloaderListener listener)
{
try
{
if(mURL != null)
{
if(this.isHTTPURL(mURL))
new PLHTTPFileDownloader(mURL, listener).downloadAsynchronously();
else
new PLLocalFileDownloader(mView.getActivity().getApplicationContext(), mURL, listener).downloadAsynchronously();
}
else if(mJSONData != null)
new Thread(new PLDataRunnable(listener, mURL, mJSONData, System.currentTimeMillis())).start();
else
listener.didErrorDownload(mURL, "JSON string is empty", -1, null);
}
catch(Throwable e)
{
PLLog.error("PLJSONLoader::requestJSON", e);
listener.didErrorDownload(mURL, e.getMessage(), -1, null);
}
}
示例7: requestJSON
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**json methods*/
protected void requestJSON(PLFileDownloaderListener listener)
{
try
{
if(mURL != null)
{
if(this.isHTTPURL(mURL))
new PLHTTPFileDownloader(mURL, listener).downloadAsynchronously();
else
new PLLocalFileDownloader(mView.getContext().getApplicationContext(), mURL, listener).downloadAsynchronously();
}
else if(mJSONData != null)
new Thread(new PLDataRunnable(listener, mURL, mJSONData, System.currentTimeMillis())).start();
else
listener.didErrorDownload(mURL, "JSON string is empty", -1, null);
}
catch(Throwable e)
{
PLLog.error("PLJSONLoader::requestJSON", e);
listener.didErrorDownload(mURL, e.getMessage(), -1, null);
}
}
示例8: setPreviewImage
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
@Override
public void setPreviewImage(PLIImage image)
{
if(image != null)
{
synchronized(mPreviewTextures)
{
this.removeAllPreviewTextures(true);
int width = image.getWidth();
int height = image.getHeight();
if(PLMath.isPowerOfTwo(width) && (height % width == 0 || width % height == 0))
{
int[] previewTilesOrder = this.getPreviewTilesOrder();
int w, h, tilesLength = this.getPreviewTilesNumber();
if(tilesLength == 1)
{
w = width;
h = height;
}
else
w = h = (width > height ? height : width);
for(int i = 0; i < tilesLength; i++)
{
try
{
PLIImage subImage = new PLImage(image.getSubImage(0, previewTilesOrder[i] * w, w, h));
mPreviewTextures[i] = new PLTexture(subImage);
}
catch(Throwable e)
{
this.removeAllPreviewTextures(true);
PLLog.error("PLPanoramaBase::setPreviewTexture", "setPreviewTexture fails: %s", e);
break;
}
}
}
}
}
}
示例9: bindTextureByIndex
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
protected boolean bindTextureByIndex(GL10 gl, int index)
{
boolean result = false;
try
{
PLITexture texture = this.getTextures()[index];
if(texture != null && texture.getTextureId(gl) != 0)
{
gl.glBindTexture(GL10.GL_TEXTURE_2D, texture.getTextureId(gl));
result = true;
if(this.getPreviewTextures()[index] != null)
this.removePreviewTextureAtIndex(index, true);
}
else
{
texture = this.getPreviewTextures()[index];
if(texture != null && texture.getTextureId(gl) != 0)
{
gl.glBindTexture(GL10.GL_TEXTURE_2D, texture.getTextureId(gl));
result = true;
}
}
}
catch(Throwable e)
{
PLLog.error("PLCubicPanorama::bindTextureByIndex", e);
}
return result;
}
示例10: didError
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
protected void didError(final Throwable e)
{
mView.getActivity().runOnUiThread
(
new Runnable()
{
@Override
public void run()
{
didError(e.toString());
PLLog.error("PLJSONLoader", e);
}
}
);
}
示例11: activateAccelerometer
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**accelerometer methods*/
protected boolean activateAccelerometer()
{
if(mSensorManager != null && mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), (int)(mAccelerometerInterval * 1000.0f)))
return true;
PLLog.debug("PLView::activateAccelerometer", "Accelerometer sensor is not available on the device!");
return false;
}
示例12: startSensorialRotation
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**sensorial rotation methods*/
@Override
public boolean startSensorialRotation()
{
if(!mIsValidForSensorialRotation)
{
if(this.activateGyroscope())
{
mHasFirstGyroscopePitch = false;
mGyroscopeLastTime = 0;
mGyroscopeRotationX = mGyroscopeRotationY = 0.0f;
mSensorialRotationType = PLSensorialRotationType.PLSensorialRotationTypeGyroscope;
mIsValidForSensorialRotation = true;
}
else
{
PLLog.debug("PLView::startSensorialRotation", "Gyroscope sensor is not available on device!");
if(mSensorManager != null && mSensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER).size() > 0 && mSensorManager.getSensorList(Sensor.TYPE_MAGNETIC_FIELD).size() > 0)
{
mSensorialRotationThresholdTimestamp = 0;
mSensorialRotationThresholdFlag = false;
mSensorialRotationAccelerometerData = new float[3];
mSensorialRotationRotationMatrix = new float[16];
mSensorialRotationOrientationData = new float[3];
mHasFirstAccelerometerPitch = mHasFirstMagneticHeading = false;
mFirstAccelerometerPitch = mLastAccelerometerPitch = mAccelerometerPitch = 0.0f;
mFirstMagneticHeading = mLastMagneticHeading = mMagneticHeading = 0.0f;
mSensorialRotationType = PLSensorialRotationType.PLSensorialRotationTypeAccelerometerAndMagnetometer;
mIsValidForSensorialRotation = true;
this.activateMagnetometer();
}
else
PLLog.debug("PLView::startSensorialRotation", "Accelerometer or/and magnetometer sensor/s is/are not available on device!");
}
return mIsValidForSensorialRotation;
}
return false;
}
示例13: activateOrientation
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**orientation methods*/
@SuppressWarnings("deprecation")
protected boolean activateOrientation()
{
if(mSensorManager != null && mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION), SensorManager.SENSOR_DELAY_GAME))
return true;
PLLog.debug("PLView::activateOrientation", "Orientation sensor is not available on the device!");
return false;
}
示例14: activateAccelerometer
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**accelerometer methods*/
protected boolean activateAccelerometer() {
if(mSensorManager != null && mSensorManager.registerListener(this, mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), (int)(mAccelerometerInterval * 1000.0f)))
return true;
PLLog.debug("PLView::activateAccelerometer", "Accelerometer sensor is not available on the device!");
return false;
}
示例15: startSensorialRotation
import com.panoramagl.utils.PLLog; //导入依赖的package包/类
/**sensorial rotation methods*/
@Override
public boolean startSensorialRotation() {
if(!mIsValidForSensorialRotation)
{
if(this.activateGyroscope())
{
mHasFirstGyroscopePitch = false;
mGyroscopeLastTime = 0;
mGyroscopeRotationX = mGyroscopeRotationY = 0.0f;
mSensorialRotationType = PLSensorialRotationType.PLSensorialRotationTypeGyroscope;
mIsValidForSensorialRotation = true;
}
else
{
PLLog.debug("PLView::startSensorialRotation", "Gyroscope sensor is not available on device!");
if(mSensorManager != null && mSensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER).size() > 0 && mSensorManager.getSensorList(Sensor.TYPE_MAGNETIC_FIELD).size() > 0)
{
mSensorialRotationThresholdTimestamp = 0;
mSensorialRotationThresholdFlag = false;
mSensorialRotationAccelerometerData = new float[3];
mSensorialRotationRotationMatrix = new float[16];
mSensorialRotationOrientationData = new float[3];
mHasFirstAccelerometerPitch = mHasFirstMagneticHeading = false;
mFirstAccelerometerPitch = mLastAccelerometerPitch = mAccelerometerPitch = 0.0f;
mFirstMagneticHeading = mLastMagneticHeading = mMagneticHeading = 0.0f;
mSensorialRotationType = PLSensorialRotationType.PLSensorialRotationTypeAccelerometerAndMagnetometer;
mIsValidForSensorialRotation = true;
this.activateMagnetometer();
}
else
PLLog.debug("PLView::startSensorialRotation", "Accelerometer or/and magnetometer sensor/s is/are not available on device!");
}
return mIsValidForSensorialRotation;
}
return false;
}