├── .clang-format
├── .gitignore
├── Doxyfile
├── Objectify.iml
├── README.md
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── de
│ │ └── hsrm
│ │ └── objectify
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── de
│ │ └── hsrm
│ │ └── objectify
│ │ ├── activities
│ │ ├── CameraActivity.java
│ │ ├── MainActivity.java
│ │ ├── ReconstructionDetailActivity.java
│ │ ├── ReconstructionListActivity.java
│ │ ├── adapter
│ │ │ └── ReconstructionListAdapter.java
│ │ └── fragments
│ │ │ ├── ImageViewerFragment.java
│ │ │ ├── ModelViewerFragment.java
│ │ │ └── ReconstructionListFragment.java
│ │ ├── camera
│ │ ├── CameraPreview.java
│ │ └── Constants.java
│ │ ├── database
│ │ ├── DatabaseAdapter.java
│ │ └── DatabaseProvider.java
│ │ ├── export
│ │ └── OBJExport.java
│ │ ├── math
│ │ ├── Matrix4f.java
│ │ ├── Quat4f.java
│ │ └── Vector3f.java
│ │ ├── rendering
│ │ ├── ObjectModel.java
│ │ ├── ReconstructionService.java
│ │ └── TouchSurfaceView.java
│ │ └── utils
│ │ ├── ArcBall.java
│ │ ├── ArrayUtils.java
│ │ ├── BitmapUtils.java
│ │ ├── CameraUtils.java
│ │ ├── Size.java
│ │ └── Storage.java
│ ├── res
│ ├── drawable-hdpi
│ │ ├── ic_action_export.png
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ ├── ic_action_export.png
│ │ └── ic_launcher.png
│ ├── drawable-nodpi
│ │ ├── background.png
│ │ ├── camera_lighting_black.9.png
│ │ ├── camera_lighting_bottom.9.png
│ │ ├── camera_lighting_left.9.png
│ │ ├── camera_lighting_right.9.png
│ │ ├── camera_lighting_top.9.png
│ │ └── lighting_mask.9.png
│ ├── drawable-xhdpi
│ │ ├── ic_action_export.png
│ │ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ │ ├── ic_action_export.png
│ │ └── ic_launcher.png
│ ├── drawable-xxxhdpi
│ │ └── ic_launcher.png
│ ├── drawable
│ │ └── background_noise.xml
│ ├── layout
│ │ ├── activity_camera.xml
│ │ ├── activity_main.xml
│ │ ├── activity_reconstruction_detail.xml
│ │ ├── activity_reconstruction_list.xml
│ │ ├── activity_reconstruction_twopane.xml
│ │ ├── fragment_height_map_view.xml
│ │ ├── fragment_input_images_view.xml
│ │ ├── fragment_model_viewer.xml
│ │ ├── fragment_normal_map_view.xml
│ │ └── subtitled_spinner_item.xml
│ ├── menu
│ │ ├── menu_main.xml
│ │ └── reconstruction.xml
│ ├── values-land
│ │ └── dimens.xml
│ ├── values-large
│ │ └── refs.xml
│ ├── values-sw600dp
│ │ └── refs.xml
│ ├── values-v11
│ │ └── styles.xml
│ ├── values-w820dp
│ │ └── dimens.xml
│ ├── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── web_hi_res_512.png
│ └── rs
│ └── de
│ └── hsrm
│ └── objectify
│ └── rendering
│ ├── compute_normals.rs
│ └── lh_integration.rs
├── build.gradle
├── doc
├── Sequenzdiagramm-Rekonstruktionsvorgang.png
├── Sequenzdiagramm-Rekonstruktionsvorgang.svg
├── app-overview.jpg
└── screenshot-app.jpg
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.clang-format:
--------------------------------------------------------------------------------
1 | # Clang-Format Style Options for 3.7+
2 | ---
3 | # We'll use defaults from the Google style, but with 4 columns indentation.
4 | BasedOnStyle: Google
5 | IndentWidth: 4
6 | ---
7 | Language: Cpp
8 | AccessModifierOffset: -2
9 | AlignConsecutiveAssignments: true
10 | AllowShortBlocksOnASingleLine: true
11 | AllowShortFunctionsOnASingleLine: Empty
12 | KeepEmptyLinesAtTheStartOfBlocks: true
13 | SpacesBeforeTrailingComments: 1
14 | SpaceAfterCStyleCast: true
15 | NamespaceIndentation: All
16 | Standard: Cpp11
17 | ---
18 | Language: JavaScript
19 | ColumnLimit: 100
20 | ---
21 | Language: Java
22 | ColumnLimit: 90
23 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | /.idea/
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | .DS_Store
9 |
--------------------------------------------------------------------------------
/Objectify.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Objectify
2 | The first mobile 3D scanner for Android.
3 |
4 | With this app you can capture 3D models of yourself, friends or family members
5 | and share the results afterwards. Objectify uses the front-facing camera and
6 | the smartphone display to create light reflections to calculate a 3D model
7 | from the picture. You can achieve best results in a very dark environment.
8 |
9 | 
10 |
11 | This app was initially developed as part of my bachelor thesis at the RheinMain
12 | University of Applied Sciences in Wiesbaden and later released at the Google
13 | Play Store. Since I don't have time anymore to actively support or develop this
14 | app, I've decided to open source it.
15 |
16 | 
17 |
18 | ## Media attention
19 |
20 | * [http://www.aptgetupdate.de/2011/08/19/objectify-mobiler-3d-scanner-fur-android/](http://www.aptgetupdate.de/2011/08/19/objectify-mobiler-3d-scanner-fur-android/)
21 | * [http://www.netzwelt.de/download/foto-grafik/3d-software-rendering/index.html](http://www.netzwelt.de/download/foto-grafik/3d-software-rendering/index.html)
22 | * [https://www.mendeley.com/research/3drekonstruktion-auf-einem-smartphone-mittels-photometric-stereo/](https://www.mendeley.com/research/3drekonstruktion-auf-einem-smartphone-mittels-photometric-stereo/)
23 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | .settings/
3 | .DS_Store
4 | app/build
5 | .gradle/
6 | .idea/
--------------------------------------------------------------------------------
/app/app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | generateDebugAndroidTestSources
19 | generateDebugSources
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Objectify. Copyright (c) 2011-2016. Kai Wolf. All rights reserved.
3 | * Redistribution and use in source form with or without modification is not permitted.
4 | */
5 |
6 | apply plugin: 'com.android.application'
7 |
8 | android {
9 | compileSdkVersion 22
10 | buildToolsVersion "22.0.1"
11 |
12 | defaultConfig {
13 | applicationId "de.hsrm.objectify"
14 | minSdkVersion 16
15 | targetSdkVersion 22
16 | renderscriptTargetApi 22
17 | versionCode 3
18 | versionName "1.2"
19 | }
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 | }
27 |
28 | dependencies {
29 | compile fileTree(dir: 'libs', include: ['*.jar'])
30 | compile group: 'org.ejml', name: 'all', version: '0.27'
31 | compile 'com.android.support:appcompat-v7:22.0.0'
32 | }
33 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/kai/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/de/hsrm/objectify/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Objectify. Copyright (c) 2011-2016. Kai Wolf. All rights reserved.
3 | * Redistribution and use in source form with or without modification is not permitted.
4 | */
5 |
6 | package de.hsrm.objectify;
7 |
8 | import android.app.Application;
9 | import android.test.ApplicationTestCase;
10 |
11 | /**
12 | * Testing
13 | * Fundamentals
14 | */
15 | public class ApplicationTest extends ApplicationTestCase {
16 | public ApplicationTest() {
17 | super(Application.class);
18 | }
19 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
18 |
19 |
24 |
27 |
28 |
29 |
30 |
31 |
32 |
35 |
38 |
41 |
44 |
45 |
46 |
47 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/app/src/main/java/de/hsrm/objectify/activities/CameraActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Objectify. Copyright (c) 2011-2016. Kai Wolf. All rights reserved.
3 | * Redistribution and use in source form with or without modification is not permitted.
4 | */
5 |
6 | package de.hsrm.objectify.activities;
7 |
8 | import android.app.Activity;
9 | import android.content.Intent;
10 | import android.content.res.Resources;
11 | import android.graphics.Bitmap;
12 | import android.graphics.BitmapFactory;
13 | import android.graphics.Matrix;
14 | import android.graphics.Point;
15 | import android.graphics.drawable.NinePatchDrawable;
16 | import android.hardware.Camera;
17 | import android.hardware.Camera.CameraInfo;
18 | import android.hardware.Camera.PictureCallback;
19 | import android.os.AsyncTask;
20 | import android.os.Bundle;
21 | import android.os.Handler;
22 | import android.view.Display;
23 | import android.view.Surface;
24 | import android.view.View;
25 | import android.view.ViewGroup.LayoutParams;
26 | import android.view.Window;
27 | import android.view.WindowManager;
28 | import android.widget.Button;
29 | import android.widget.ImageView;
30 | import android.widget.LinearLayout;
31 |
32 | import java.util.ArrayList;
33 |
34 | import de.hsrm.objectify.R;
35 | import de.hsrm.objectify.camera.CameraPreview;
36 | import de.hsrm.objectify.camera.Constants;
37 | import de.hsrm.objectify.rendering.ReconstructionService;
38 | import de.hsrm.objectify.utils.BitmapUtils;
39 | import de.hsrm.objectify.utils.CameraUtils;
40 | import de.hsrm.objectify.utils.Size;
41 | import de.hsrm.objectify.utils.Storage;
42 |
43 | public class CameraActivity extends Activity {
44 | public static final String RECONSTRUCTION = "new_reconstruction";
45 | private CameraPreview mCameraPreview;
46 | private ImageView mCameraLighting;
47 | private ImageView mCameraLightingMask;
48 | private Button mTriggerPicturesButton;
49 | private LinearLayout mProgressScreen;
50 | private Camera mCamera;
51 | private String mDirName;
52 | private int mImgCounter;
53 | private int mCameraRotation;
54 | private ArrayList mLightSourcesList;
55 |
56 | @Override
57 | protected void onCreate(Bundle savedInstanceState) {
58 | super.onCreate(savedInstanceState);
59 |
60 | /* make the activity fullscreen */
61 | requestWindowFeature(Window.FEATURE_NO_TITLE);
62 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
63 | WindowManager.LayoutParams.FLAG_FULLSCREEN);
64 | setContentView(R.layout.activity_camera);
65 |
66 | /* opening front facing camera */
67 | mCamera = openFrontFacingCamera();
68 |
69 | mProgressScreen = (LinearLayout) findViewById(R.id.preparing);
70 | mCameraPreview = (CameraPreview) findViewById(R.id.camera_surface);
71 | mCameraPreview.setCamera(mCamera);
72 | mCameraLighting = (ImageView) findViewById(R.id.camera_lighting);
73 | mCameraLightingMask = (ImageView) findViewById(R.id.camera_lighting_mask);
74 | mTriggerPicturesButton = (Button) findViewById(R.id.trigger_images_button);
75 | mTriggerPicturesButton.setOnClickListener(new View.OnClickListener() {
76 |
77 | @Override
78 | public void onClick(View view) {
79 | mImgCounter = 0;
80 | mDirName = Storage.getRandomName(10);
81 | setupDisplayScreen();
82 | takePicture();
83 | }
84 | });
85 |
86 | /* prepare the different light sources */
87 | new PrepareLightSources().execute(getDisplayScreenSize());
88 | }
89 |
90 | @Override
91 | protected void onPause() {
92 | super.onPause();
93 | releaseCamera();
94 | }
95 |
96 | private void takePicture() {
97 | mCameraLighting.setImageDrawable(mLightSourcesList.get(mImgCounter));
98 | /* give the light source view a little time to update itself */
99 | new Handler().postDelayed(new Runnable() {
100 | @Override
101 | public void run() {
102 | mCamera.takePicture(null, null, cameraImageCallback());
103 | }
104 | }, 25);
105 | }
106 |
107 | private PictureCallback cameraImageCallback() {
108 | return new PictureCallback() {
109 |
110 | @Override
111 | public void onPictureTaken(byte[] bytes, Camera camera) {
112 | Bitmap bmp = CameraUtils.fixRotateMirrorImage(
113 | BitmapFactory.decodeByteArray(bytes, 0, bytes.length));
114 | /* rotate camera image according to camera rotation (portrait vs.
115 | * landscape) */
116 | Matrix matrix = new Matrix();
117 | /* compensate the mirror */
118 | matrix.postRotate((360 - mCameraRotation) % 360);
119 | bmp = Bitmap.createBitmap(
120 | bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true);
121 |
122 | String fileName =
123 | Constants.IMAGE_NAME + mImgCounter + "." + Constants.IMAGE_FORMAT;
124 | BitmapUtils.saveBitmap(
125 | BitmapUtils.convertToGrayscale(bmp), mDirName, fileName);
126 | mImgCounter += 1;
127 | mCamera.startPreview();
128 | if (mImgCounter <= Constants.NUM_IMAGES) {
129 | takePicture();
130 | } else {
131 | /* start 3d reconstruction asynchronously in background */
132 | Intent photometricStereo =
133 | new Intent(getApplicationContext(), ReconstructionService.class);
134 | photometricStereo.putExtra(
135 | ReconstructionService.DIRECTORY_NAME, mDirName);
136 | startService(photometricStereo);
137 | /* move to 3d viewer already */
138 | Intent view3DModel = new Intent(
139 | getApplicationContext(), ReconstructionListActivity.class);
140 | view3DModel.putExtra(RECONSTRUCTION, true);
141 | startActivity(view3DModel);
142 | finish();
143 | }
144 | }
145 | };
146 | }
147 |
148 | private void setupDisplayScreen() {
149 | /* hide camera preview */
150 | LayoutParams layoutParams = mCameraPreview.getLayoutParams();
151 | layoutParams.width = 0;
152 | layoutParams.height = 0;
153 | mCameraPreview.setLayoutParams(layoutParams);
154 | mTriggerPicturesButton.setVisibility(
155 | View.INVISIBLE); /* hide camera trigger button */
156 | mCameraLightingMask.setVisibility(View.INVISIBLE); /* hide lighting mask */
157 | mCameraLighting.setVisibility(View.VISIBLE); /* show light sources on screen */
158 | }
159 |
160 | private Camera openFrontFacingCamera() {
161 | Camera camera;
162 | int camId = CameraInfo.CAMERA_FACING_FRONT;
163 | try {
164 | camera = Camera.open(camId);
165 | } catch (RuntimeException ex) {
166 | /* no front camera found, trying the first one found */
167 | camId = 0;
168 | camera = Camera.open(camId);
169 | }
170 |
171 | /* determine current rotation of device */
172 | mCameraRotation = getDisplayRotation();
173 | CameraInfo info = new CameraInfo();
174 | Camera.getCameraInfo(camId, info);
175 |
176 | /* set front facing camera to portrait mode */
177 | int result = (info.orientation + mCameraRotation) % 360;
178 | /* compensate the mirror */
179 | result = (360 - result) % 360;
180 | camera.setDisplayOrientation(result);
181 | Camera.Parameters params = camera.getParameters();
182 |
183 | /* set camera picture size to preferred image resolution */
184 | Camera.Size targetSize =
185 | CameraUtils.determineTargetPictureSize(params, Constants.IMAGE_RESOLUTION);
186 | params.setPictureSize(targetSize.width, targetSize.height);
187 | camera.setParameters(params);
188 |
189 | return camera;
190 | }
191 |
192 | private int getDisplayRotation() {
193 | switch (getWindowManager().getDefaultDisplay().getRotation()) {
194 | case Surface.ROTATION_0:
195 | return 0;
196 | case Surface.ROTATION_90:
197 | return 90;
198 | case Surface.ROTATION_180:
199 | return 180;
200 | case Surface.ROTATION_270:
201 | return 270;
202 | }
203 |
204 | return 0;
205 | }
206 |
207 | private Size getDisplayScreenSize() {
208 | Display display = getWindowManager().getDefaultDisplay();
209 | Point size = new Point();
210 | display.getSize(size);
211 | return new Size(size.x, size.y);
212 | }
213 |
214 | private void releaseCamera() {
215 | if (mCamera != null) {
216 | mCameraPreview.setCamera(null);
217 | mCamera.release();
218 | mCamera = null;
219 | }
220 | }
221 |
222 | private class PrepareLightSources extends AsyncTask {
223 | private NinePatchDrawable getCamLighting(
224 | Resources res, Size size, int drawableId) {
225 | NinePatchDrawable npd = (NinePatchDrawable) res.getDrawable(drawableId);
226 | if (npd != null) {
227 | npd.setBounds(0, 0, size.width, size.height);
228 | }
229 | return npd;
230 | }
231 |
232 | @Override
233 | protected Void doInBackground(Size... sizes) {
234 | mLightSourcesList = new ArrayList();
235 |
236 | Resources res = getResources();
237 | mLightSourcesList.add(
238 | getCamLighting(res, sizes[0], R.drawable.camera_lighting_black));
239 | mLightSourcesList.add(
240 | getCamLighting(res, sizes[0], R.drawable.camera_lighting_left));
241 | mLightSourcesList.add(
242 | getCamLighting(res, sizes[0], R.drawable.camera_lighting_top));
243 | mLightSourcesList.add(
244 | getCamLighting(res, sizes[0], R.drawable.camera_lighting_right));
245 | mLightSourcesList.add(
246 | getCamLighting(res, sizes[0], R.drawable.camera_lighting_bottom));
247 |
248 | return null;
249 | }
250 |
251 | @Override
252 | protected void onPostExecute(Void aVoid) {
253 | mProgressScreen.setVisibility(View.INVISIBLE);
254 | }
255 | }
256 | }
257 |
--------------------------------------------------------------------------------
/app/src/main/java/de/hsrm/objectify/activities/MainActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Objectify. Copyright (c) 2011-2016. Kai Wolf. All rights reserved.
3 | * Redistribution and use in source form with or without modification is not permitted.
4 | */
5 |
6 | package de.hsrm.objectify.activities;
7 |
8 | import android.app.Activity;
9 | import android.content.Intent;
10 | import android.os.Bundle;
11 | import android.view.Menu;
12 | import android.view.MenuItem;
13 | import android.view.View;
14 |
15 | import de.hsrm.objectify.R;
16 |
17 | public class MainActivity extends Activity {
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.activity_main);
22 | }
23 |
24 | @Override
25 | public boolean onCreateOptionsMenu(Menu menu) {
26 | /* inflate the menu; this adds items to the action bar, if it is present */
27 | getMenuInflater().inflate(R.menu.menu_main, menu);
28 | return true;
29 | }
30 |
31 | @Override
32 | public boolean onOptionsItemSelected(MenuItem item) {
33 | switch (item.getItemId()) {
34 | case R.id.action_settings:
35 | return true;
36 | case R.id.action_about:
37 | return true;
38 | }
39 | return super.onOptionsItemSelected(item);
40 | }
41 |
42 | public void galleryButtonClick(View target) {
43 | Intent gallActivity =
44 | new Intent(getApplicationContext(), ReconstructionListActivity.class);
45 | startActivity(gallActivity);
46 | }
47 |
48 | public void scanButtonClick(View target) {
49 | Intent camActivity = new Intent(getApplicationContext(), CameraActivity.class);
50 | startActivity(camActivity);
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/de/hsrm/objectify/activities/ReconstructionDetailActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Objectify. Copyright (c) 2011-2016. Kai Wolf. All rights reserved.
3 | * Redistribution and use in source form with or without modification is not permitted.
4 | */
5 |
6 | package de.hsrm.objectify.activities;
7 |
8 | import android.app.ActionBar;
9 | import android.app.Activity;
10 | import android.app.Fragment;
11 | import android.app.FragmentTransaction;
12 | import android.content.BroadcastReceiver;
13 | import android.content.Context;
14 | import android.content.Intent;
15 | import android.content.IntentFilter;
16 | import android.net.Uri;
17 | import android.os.Bundle;
18 | import android.support.v4.app.NavUtils;
19 | import android.view.Menu;
20 | import android.view.MenuItem;
21 | import android.view.View;
22 | import android.widget.LinearLayout;
23 | import android.widget.SimpleAdapter;
24 | import android.widget.SpinnerAdapter;
25 |
26 | import java.util.ArrayList;
27 | import java.util.HashMap;
28 | import java.util.List;
29 | import java.util.Map;
30 |
31 | import de.hsrm.objectify.R;
32 | import de.hsrm.objectify.activities.fragments.ImageViewerFragment;
33 | import de.hsrm.objectify.activities.fragments.ModelViewerFragment;
34 | import de.hsrm.objectify.camera.Constants;
35 | import de.hsrm.objectify.rendering.ReconstructionService;
36 |
37 | /**
38 | * An activity representing a single Reconstruction detail screen. This activity is only
39 | * used on handset devices. On tablet-size devices, item details are presented
40 | * side-by-side with a
41 | * list of items in a {@link ReconstructionListActivity}. This activity is mostly just a
42 | * 'shell'
43 | * activity containing no more than a {@link
44 | * de.hsrm.objectify.activities.fragments.ImageViewerFragment}
45 | */
46 | public class ReconstructionDetailActivity
47 | extends Activity implements ImageViewerFragment.OnFragmentInteractionListener,
48 | ModelViewerFragment.OnFragmentInteractionListener {
49 | public static final String REC_NORMALMAP = "normalmap";
50 | public static final String REC_HEIGHTMAP = "heightmap";
51 | public static final String REC_3DMODEL = "3dmodel";
52 | private final String TAG = "ReconstructionDetailActivity";
53 | private LinearLayout mProgressScreen;
54 | private Fragment mCurrentFragment;
55 | private String mGalleryId;
56 | private BroadcastReceiver receiver = new BroadcastReceiver() {
57 |
58 | @Override
59 | public void onReceive(Context context, Intent intent) {
60 | Bundle bundle = intent.getExtras();
61 | if (bundle != null) {
62 | disableProgressScreen();
63 | mGalleryId = bundle.getString(ReconstructionService.GALLERY_ID);
64 | mCurrentFragment =
65 | ImageViewerFragment.newInstance(mGalleryId, REC_NORMALMAP);
66 | updateCurrentViewFragment();
67 | }
68 | }
69 | };
70 |
71 | @Override
72 | protected void onCreate(Bundle savedInstanceState) {
73 | super.onCreate(savedInstanceState);
74 | setContentView(R.layout.activity_reconstruction_detail);
75 |
76 | /* populate android actionbar dropdown list for all fragments */
77 | List